Android自定义属性之format介绍

2014-11-24 12:33:23 · 作者: · 浏览: 2

1. reference:参考某一资源ID。


(1)属性定义:



background" format = "reference" />



(2)属性使用:



android:layout_width = "42dip"
android:layout_height = "42dip"
android:background = "@drawable/图片ID"


/>


2. color:颜色值。


(1)属性定义:



textColor" format = "color" />



(2)属性使用:



android:layout_width = "42dip"
android:layout_height = "42dip"
android:textColor = "#00FF00"


/>


3. boolean:布尔值。


(1)属性定义:



focusable" format = "boolean" />



(2)属性使用:



android:layout_width = "42dip"
android:layout_height = "42dip"


android:focusable = "true"


/>


4. dimension:尺寸值。


(1)属性定义:



layout_width" format = "dimension" />



(2)属性使用:



android:layout_width = "42dip"
android:layout_height = "42dip"


/>