提供android自定义属性format详解.pdf
1.reference:参考某一资源ID。
declare-styleablename=名称
attrname=backgroundformat
=reference/
/declare-styleable
(2)属性使用:
ImageView
android:layout_width=
42dip
android:layout_height=42dip
android:background=@drawable/ID
/
2.color:颜色值。
declare-styleablename=名称
attrname=textColorformat
=color/
/declare-styleable
(2)属性使用:
TextView
android:layout_width=
42dip
android:layout_height=42dip
android:textColor=#00FF00
/
3.boolean:布尔值。
declare-styleablename=名称
attrname=focusableformat
=boolean/
/declare-styleable
(2)属性使用:
Button
android:layout_width=42dip
android:layout_height=42dip
android:focusable=true
/
4.dimension:尺寸值。
declare-styleablename=名称
attrname=layout_width
format=dimension/
/declare-styleable
(2)属性使用:
Button
android:layout_width=42dip
android:layout_height=
42dip