屬性名稱使用小駝峰命名規則
- reference:某一資源的id
ImageView 的src屬性 - color:色值
TextView 的textColor屬性 - boolean: 布爾值
Button 的focusable屬性 - dimension: 尺寸值
View 的layout_width - float:浮點值
ImageView 的 alpha屬性 - integer: 整型
TextView 的 maxLines - string: 字符串
TextView 的text屬性 - fraction: 百分數
rotate動畫 的pivotX屬性 - enum:枚舉值
LinearLayout的orientatin屬性vertical/horizontal - flag:位或運算
activity的windowSoftInputMode屬性
屬性定義時可以指定多種類型值:
<declare-styleable name = "名稱">
<attr name = "background" format = "reference|color" />
</declare-styleable>