“`”

①.自定义View的属性 编写attr.xml文件
②.在layout布局文件中引用,同时引用命名空间
③.在View的构造方法中获得我们自定义的属性 ,在自定义控件中进行读取(构造方法拿到attr.xml文件值)
④.重写onMesure
⑥.重写onDraw

<pre><code> "“`

Was this helpful?

0 / 0

发表回复 0

Your email address will not be published.