android开发记录

13.5.14

1.自定义的view要放在xml里面使用,需要实现构造方法

public Chessboard(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}

public Chessboard(Context context) {
super(context);
// TODO Auto-generated constructor stub}

2.要显示内容,可以通过实现onDraw来显示

13.5.15

3.读取资源中图片的方法BitmapFactory.decodeResource(this.getResources(),R.drawable.empty)

posted @ 2013-05-14 20:35  zerojetlag  阅读(126)  评论(0)    收藏  举报