自定义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中
#异常的解决
可能两种原因引起:
原因一:
必须实现三个构造函数:
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中
相关文章推荐
- Android:ContentProvider
- (十)android项目中,通用布局的对话框的实现。
- android ndk 编译错误
- adb logcat命令查看并过滤android输出log
- 【笔记】Android开发中R文件丢失的解决方法
- Android apk动态加载机制的研究
- Android Studio中创建Kotlin For Android项目
- Android Studio中创建Kotlin For Android项目
- game测试:(android项目设计师角色)01立项: 框架设计,详细设计
- android接入支持海外的支付,visa,mastercard
- android 图片裁减
- Android工具代码
- Parcelable接口
- android菜鸟进阶之路—— AsyncTask的使用
- Android FTP ftpClient.listFiles()报java.lang.ClassNotFoundException: Didn't find class "Windows_NT"
- Android学习笔记之:NDK开发环境配置
- Android 签名机制
- android:inputType罗列
- Android控件使用—EditText的一些注意事项
- Android layout 属性