Fresco 初體驗各種問題解決

Fresco 初體驗各種問題解決

  • xmlns:fresco="http://schemas.android.com/apk/res-auto"顯示爲灰色,沒有應用到
    這裏寫圖片描述

    1. 解決辦法

    把引用圖片的方式(src)改爲:fresco:placeholderImage
    這裏寫圖片描述

  • 初始化位置錯誤

Error inflating class com.facebook.drawee.view.SimpleDraweeView 
android.view.InflateException: Binary XML file line #14: Error inflating class com.facebook.drawee.view.SimpleDraweeView
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.NullPointerException
            at com.facebook.drawee.view.DraweeView.setImageDrawable(DraweeView.java:140)
  • 1
  • 2
  • 3
  • 4
  • 5

這裏是沒有引用到`com.facebook.drawee.view.SimpleDraweeView

1.解決辦法

把初始化Fresco調整到setContentView(R.layout.activity_main);上邊
這裏寫圖片描述


  • 圖片不顯示
    這裏寫圖片描述
    1.解決辦法

Fresco 是不支持wrap_content所以我們把相應的地方改爲數值:100dp之類的,更具具體情況定
這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章