android.view.InflateException: Binary XML file line自定义view的构造函数引起

来源:互联网 发布:linux 百度云盘同步 编辑:程序博客网 时间:2024/05/20 19:46

自定义view的构造函数问题

如果是xml文件引入必须实现带AttributeSet属性参数的构造函数,否则报此错误

 //Simple constructor to use when creating a view from code View(Context context)      //Constructor that is called when inflating a view from XML View(Context context, AttributeSet attrs)      //Perform inflation from XML and apply a class-specific base style View(Context context, AttributeSet attrs, int defStyle)    
阅读全文
0 0
原创粉丝点击