参考:http://blog.csdn.net/mayingcai1987/article/details/6216655
Android中 declare-styleable format属性
1. reference:参考某一资源ID
<attr name = "background" format = "reference" />
2. color:颜色值
<attr name = "textColor" format = "color" />
3. boolean:布尔值
<attr name = "focusable" format = "boolean" />
4. dimension:尺寸值
<attr name = "layout_width" format = "dimension" />
5. float:浮点值
<attr name = "fromAlpha" format = "float" />
6. integer:整型值
<attr name = "framesCount" format="integer" />
7. string:字符串
<attr name = "apiKey" format = "string" />
8. fraction:百分数
<attr name = "pivotX" format = "fraction" />
9. enum:枚举值
<attr name="orientation">
<enum name="horizontal" value="0" />
<enum name="vertical" value="1" />
</attr>
10. flag:位或运算
<attr name="windowSoftInputMode">
<flag name = "stateUnspecified" value = "0" />
<flag name = "stateUnchanged" value = "1" />
<flag name = "stateHidden" value = "2" />
<flag name = "stateAlwaysHidden" value = "3" />
<flag name = "stateVisible" value = "4" />
<flag name = "stateAlwaysVisible" value = "5" />
<flag name = "adjustUnspecified" value = "0x00" />
<flag name = "adjustResize" value = "0x10" />
<flag name = "adjustPan" value = "0x20" />
<flag name = "adjustNothing" value = "0x30" />
</attr>
What's More:
属性定义时可以指定多种类型值。
<attr name = "background" format = "reference|color" />