not using the 2- or 3-argument View constructors
来源:互联网 发布:tensorflow 小说生成 编辑:程序博客网 时间:2024/06/05 08:58
Android 在使用自定义控件的时候,会提示这样的错误信息:
not using the 2- or 3-argument View constructors; XML attributes will not work
往是由于你只定义了一个构造函数,解决方法就是至少要定义两个构造函数
处理如下:
public SlideButton(Context context) {super(context);initBitmap();}public SlideButton(Context context, AttributeSet attrs){super(context,attrs);initBitmap();}public SlideButton(Context context,AttributeSet attrs,int defStyle){super(context,attrs,defStyle);initBitmap();}
如果你只写了第一个构造函数,那么就会扡这个错误,至少要写上第二个或第三个构造函数才可以!!
1 0
- not using the 2- or 3-argument View constructors
- 自定义控件出现Custom view * is not using the 2- or 3-argument View constructors
- 自定义控件:not using the 2- or 3-argument View constructors
- Android 自定义控件build时提示Custom view * is not using the 2- or 3-argument View constructors; XML attribut
- 自定义安卓控件错误 Custom view MySwitchBtn is not using the 2- or 3-argument View constructors; XML attribute
- Custome View is not using the 2-or-3-argumentView constructors
- Android Bug:Custom view * is not using the 2- or 3-argument
- Android笔记:自定义控件-is not using the 2- or 3-argument Vieconstructors; XML attributes will not work
- android错误提醒之:Custom view * is not using the 2- or&nb(自定义控件)
- Why we declare the constructors as protected or even private?
- The view 'Index' or its master was not found or no view engine supports the searched locations.
- Using String class constructors
- 1414 - OUT or INOUT argument 3 for routine nenghao.xxx is not a variable or NEW pseudo-variable in B
- Error Code: 1414. OUT or INOUT argument 2 for routine company.new_procedure is not a variable or NEW
- "Missing or invalid signature. The bundle '' at bundle path '' is not signed using an Apple submiss
- The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an asse
- The type or namespace name '***' could not be found (are you missing a using directive or an asse
- TypeError: argument 1 must be string or buffer, not instance
- Android Android自带的Base64知识总结
- 在Mac下搭建Docker并共享文件
- mondrian schema文件:中文读取乱码并出错 的解决
- Android 视频深入解析
- 网页登录时密码如何传输?
- not using the 2- or 3-argument View constructors
- 解决ubuntu强制关机后root登录用户消失,只能访客登录问题
- windows oid 利用SNMP获得主机信息
- Cocos2d-x Lua脚本基本语法
- Monty说MySQL的优化(四)
- xml 转义特殊字符
- 第14周项目1 折腾二维数组2
- Makefile中的变量
- 基于 Android NDK 的学习之旅----- C调用Java