Android自定义属性时format选项可以取用的值
 
1. reference:参考某一资源ID。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<ImageView
 
 
2. color:颜色值。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<TextView
 
 
3. boolean:布尔值。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<Button
 
 
4. dimension:尺寸值。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<Button
 
 
5. float:浮点值。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<alpha
 
 
6. integer:整型值。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<animated-rotate
/>
 
 
7. string:字符串。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<com.google.android.maps.MapView
 
 
8. fraction:百分数。
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<rotate
/>
 
 
9. enum:枚举值。
(1)属性定义:
[html] view plaincopyprint?
</attr>
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<LinearLayout
</LinearLayout>
 
 
10. flag:位或运算。
(1)属性定义:
[html] view plaincopyprint?
</attr>
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<activity
</activity>
 
 
注意:属性定义时可以指定多种类型值:
(1)属性定义:
[html] view plaincopyprint?
</declare-styleable>
 
 
(2)属性使用:
[html] view plaincopyprint?
<ImageView
 
摘自:http://blog.csdn.net/heng615975867/article/details/12834833

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-08
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2021-11-21
  • 2022-01-14
  • 2021-10-30
  • 2021-09-16
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案