摘要:
零、序 系统自带的View可以在xml中配置属性,对于写的好的Custom View同样可以在xml中配置属性,为了使自定义的View的属性可以在xml中配置,需要以下4个步骤: 通过<declare-styleable>为自定义View添加属性 在xml中为相应的属性声明属性值 在运行时(一般为构 阅读全文
posted @ 2016-09-06 17:43
山高我为峰
阅读(1427)
评论(0)
推荐(0)
摘要:
public View(Context context):源代码中的解释如下:在Code中实例化一个View就会调用第一个构造函数 /** * Simple constructor to use when creating a view from code. * * @param context The Context the view is running ... 阅读全文
posted @ 2016-09-06 17:08
山高我为峰
阅读(735)
评论(0)
推荐(0)
摘要:
LayoutInflater作用是将layout的xml布局文件实例化为View类对象。 实现LayoutInflater的实例化共有3种方法, (1).通过SystemService获得 (2).从给定的context中获得 (3). 其实,这三种方式本质是相同的,从源码中可以看出: getLay 阅读全文
posted @ 2016-09-06 15:32
山高我为峰
阅读(366)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2016-09-06 11:45
山高我为峰
阅读(6391)
评论(0)
推荐(0)
浙公网安备 33010602011771号