您的位置:首页 > 移动开发 > Android开发

自定义View时出现:"android.view.InflateException: Binary XML file line报错问题"

2015-09-08 11:11 555 查看
Android.View.InflateException: Binary XML File Line
#异常的解决

可能两种原因引起:

原因一:

必须实现三个构造函数:

public GalleryFlow(Context context) {

super(context);

}

public GalleryFlow(Context context, AttributeSet attrs) {

super(context, attrs);

}

public GalleryFlow(Context context, AttributeSet attrs, int defStyle) {

super(context, attrs, defStyle);

}

原因二:

或者XML中包错!

<com.yourpackege.yourLayout

android:id="@+id/name"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="@color/transparent"/>

中yourLayout这个类不在com.yourpackege中
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: