码迷,mamicode.com
首页 > 其他好文 > 详细

Custome View is not using the 2-or-3-argumentView constructors

时间:2015-04-03 17:20:23      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:

今天在自定义一个View的时候遇到一个问题我把自定义的view写到布局下如下所示:

技术分享

结果运行就崩溃,查看了下布局文件才发下报了以下错误

技术分享



导致这个错误的原因是在自定义view的时候没有写它的2个或3个参数的构造方法

我只写了它的一个参数的方法

public class DrawWalkClockView extends View {

	private static final String TAG = "DrawWalkClockView";

	private boolean isRun=false;
	
	public DrawWalkClockView(Context context) {
		super(context);
	}
大家以后要注意


Custome View is not using the 2-or-3-argumentView constructors

标签:

原文地址:http://blog.csdn.net/dmk877/article/details/44857489

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!