前面在写 Android学习小demo(1)自定义View 的时候,自定义的drawable 属性是指向 drawable 中的某一张图片,如下:
attrs.xml
<resources>
<declare-styleable name="CustomRotateView">
<attr name="drawable" format="reference"/>
<attr name="degree" format="float" />
<attr name="bgcolor" format="color" />
</declare-styleable>
</resources>
Layout xml
<com.example.apidemostudy.CustomRotateView
android:id="@+id/rotateView1"
android:layout_width="240dip"
android:la