<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">第一篇学习笔记,就随便记录点。</span>
新建一个类,继承View
复写2种构造方法
复写onDraw方法
在自定义View里面完成实现目标后,分类封装(绘图、逻辑)
在res文件夹的values中新建attrsd的xml文件
新建样式
<pre name="code" class="html"><declare-styleable name="example">
<attr name="example1" format="integer"/>
<attr name="example2" format="boolean"/>
</declare-styleable>
</pre><pre name="code" class="html">
在布局文件中,引入命名空间
<pre na