自定义控件:not using the 2- or 3-argument View constructors
来源:互联网 发布:单片机定时器工作原理 编辑:程序博客网 时间:2024/06/08 09:04
在使用自定义控件时,有时会遇到这种情况:
出现这种情况往往是由于在自定义控件时你只定义了一个构造函数,解决方法就是至少要定义两个构造函数
处理如下:
public CustomHorizontalScrollView(Context context) {super(context);this.context = context;}public CustomHorizontalScrollView(Context context, AttributeSet attrs) {super(context, attrs);this.context = context;}public CustomHorizontalScrollView(Context context, AttributeSet attrs,int defStyle) {super(context, attrs, defStyle);this.context = context;}
如果你只写了第一个构造函数,那么就会报这个错误,至少要写上第二个或第三个构造函数才可以。
0 0
- 自定义控件出现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
- not using the 2- or 3-argument View constructors
- Custome View is not using the 2-or-3-argumentView constructors
- Android笔记:自定义控件-is not using the 2- or 3-argument Vieconstructors; XML attributes will not work
- Android Bug:Custom view * is not using the 2- or 3-argument
- 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
- 自定义控件,自定义View
- 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
- Mac启用自带FTP服务
- 蓝牙 开发 入门 小实例 (寻找连接阶段)
- JavaScript学习总结(十二)——JavaScript编写类
- shader开发_4.Surface shader初探
- 如何用Mac线刷小米手机
- 自定义控件:not using the 2- or 3-argument View constructors
- DAY_12 baconic crpetogram
- 湖南省第六届省赛 汽水瓶(模拟)
- 如何禁止(表单)用户名、密码自动填充
- PHP过滤常用标签的正则表达式
- Mac下安装pillow
- 通过RTMP play分析FLV格式详解
- 自定义AlertDialog对话框,包括解决对话框中edittext不能输入的问题
- 记一次Ubuntu安装Oracle纪录