Fresco 初體驗各種問題解決
xmlns:fresco="http://schemas.android.com/apk/res-auto"顯示爲灰色,沒有應用到
- 解決辦法
把引用圖片的方式(
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
之類的,更具具體情況定