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中。
可能两种原因引起:
原因一:
必须实现三个构造函数:
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中。
本文探讨了Binary XML File Line#异常的两种常见原因及其解决方案。一是确保自定义视图实现了所有必需的构造函数;二是检查XML布局文件中的命名空间和类名是否正确。
1万+

被折叠的 条评论
为什么被折叠?



