博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Custom view * is not using the 2- or 3-argument View constructors; XML attributes will not work
阅读量:4598 次
发布时间:2019-06-09

本文共 395 字,大约阅读时间需要 1 分钟。

转自

 

写三个构造函数就OK了:

public class ExtendedClass extends Button {

 
public
ExtendedClass(Context context) {
 
super( context, attrs );
}
 
public
ExtendedClass(Context context, AttributeSet attrs) {
 
super( context, attrs );
}
 
public
ExtendedClass(Context context, AttributeSet attrs, int defStyle) {
 
super( context, attrs, defStyle );
}
 
}

 

转载于:https://www.cnblogs.com/wuyihong/archive/2012/08/18/2645892.html

你可能感兴趣的文章
php生成验证码 参考PHP手册
查看>>
[Hadoop]Hadoop章2 HDFS原理及读写过程
查看>>
344. Reverse String
查看>>
迭代最近点算法 Iterative Closest Points
查看>>
2015AppStore 上传步骤及常见问题
查看>>
[lintcode easy]Product of Array Exclude Itself
查看>>
OSI七层模型详解
查看>>
Vi编辑器常用命令
查看>>
ACM学习历程——UVA442 Matrix Chain Multiplication(栈)
查看>>
CSS 布局
查看>>
Firefox的缓存问题
查看>>
ENSP错误
查看>>
Java MVC 分页实例
查看>>
响应式布局1--媒体查询和-webkit-min-device-pixel-ratio
查看>>
CocoaPods应用于iOS项目框架管理方案
查看>>
POJ-3233 Matrix Power Series 矩阵A^1+A^2+A^3...求和转化
查看>>
IIS是如何处理ASP.NET请求的
查看>>
SSIS之Foreach循环容器应用
查看>>
局域网内访问机器时出现“未授予在次计算机上的请求登陆类型”
查看>>
硬币组合问题
查看>>