我正在尝试使用Fresco库。我以前也用过它,它可以正常工作,但是现在由于某些原因,我遇到了以下问题:
Unable to start activity ComponentInfo{com.example.home.template/com.example.home.template.MainActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class com.facebook.drawee.view.SimpleDraweeView
我的xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/profileImage"
fresco:actualImageScaleType="centerCrop"
android:layout_width="200dp"
android:layout_gravity="center_horizontal"
android:layout_height="200dp" />
</LinearLayout>
我的应用程序:
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FacebookSdk.sdkInitialize(this);
}
}
我在清单文件中有这个:
android:name=".MyApplication"
我遇到的唯一问题是使用draweeview。我可以完成其他操作,如登录和获取信息。
fresco
库? - Mounir Elfassi