序号 | format取值 | format说明 | format读取 |
1 | reference | 资源ID | attrs.getResourceId(R.styleable.View名称_attr名称, 默认值); |
2 | color | 颜色值 | attrs.getColor(R.styleable.View名称_attr名称, 默认值); |
3 | boolean | 布尔值 | attrs.getBoolean(R.styleable.View名称_attr名称, 默认值); |
4 | dimension | 尺寸值 | attrs.getDimension(R.styleable.View名称_attr名称, 默认值); |
5 | float | 浮点值 | attrs.getFloat(R.styleable.View名称_attr名称, 默认值); |
6 | integer | 整型值 | attrs.getInteger(R.styleable.View名称_attr名称, 默认值); |
7 | string | 字符串 | attrs.getString(R.styleable.View名称_attr名称); |
8 | fraction | 百分比 | attrs.getString(R.styleable.View名称_attr名称); |
9 | enum | 枚举值 | attrs.getInt(R.styleable.View名称_attr名称, 默认值); |
10 | flag | 位或运算 | attrs.getInt(R.styleable.View名称_attr名称, 默认值); |