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

(1)属性定义:

(2)属性使用:

android:layout_width="42dip"

android:layout_height="42dip"

android:background="@drawable/图片ID"/>

2. color:颜色值。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:layout_width="42dip"

android:layout_height="42dip"

android:textColor="#00FF00"/>

3. boolean:布尔值。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:layout_width="42dip"

android:layout_height="42dip"

android:focusable="true"/>

4. dimension:尺寸值。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:layout_width="42dip"

android:layout_height="42dip"/>

5. float:浮点值。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:fromAlpha="1.0"

android:toAlpha="0.7"/>

6. integer:整型值。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:frameDuration="100"

android:framesCount="12"

/>

7. string:字符串。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:apiKey="0jOkQ80oD1JL9C6HAja99uGXCRiS2CGjKO_bc_g"/>

8. fraction:百分数。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:pivotX="200%"

android:pivotY="300%"

/>

9. enum:枚举值。

(1)属性定义:

[html]view plaincopy

print?

(2)属性使用:

[html]view plaincopy

print?

android:orientation="vertical">

10. flag:位或运算。

(1)属性定义:

(2)属性使用:

android:windowSoftInputMode="stateUnspecified | stateUnchanged | stateHidden">

注意:属性定义时可以指定多种类型值:

(1)属性定义:

(2)属性使用:

android:layout_width="42dip"

android:layout_height="42dip"

android:background="@drawable/图片ID|#00FF00"/>

android开发(37)

•Android SDK无法更新2013-11-08阅读808

•Android View绘制流程2013-11-06阅读792

•Android onTouch事件传递机制2013-10-31阅读622

•解决韩版I9100刷4.0系统后不能锁屏的问题2012-09-13阅读1116

•Android中Shape Drawable在xml中的使用2012-06-18阅读9733

•eclipse中的快捷键2012-06-11阅读455

•在eclipse的工具栏中不显示Android SDK and AVD Manager2013-11-08阅读14881

•Android中的viewStub、requestFocus、include、merge标签2013-11-01阅读3225

•adb shell命令详解2012-11-13阅读551

•Android反编译apk得到java源码的方法2012-08-06阅读399

•git代码管理工具使用2012-06-12阅读704

更多文章

Android高级组件难点精讲

Android5.0新特征详解(Material Design入门篇)

Android高级界面控件难点精讲

Android开发-零基础到精通疯狂实战教程第二季

Android入门实战教程

Android自定义属性attr标签format属性值

Android自定义属性format详解

Android自定义属性attr format取值类型

Android自定义属性format详解

Android自定义属性attr format取值类型

更多相关文章

  1. Android 读取资源文件实例详解
  2. 自定义ProgressBar的样式失效
  3. android实现好看的自定义提示框
  4. android自定义keystore
  5. android fragment学习5--fragment扩展 TabLayout非自定义
  6. Android启动时启动Activity 的定义的位置

随机推荐

  1. 【Android】实现XML解析的几种技术
  2. (转)Android中LocationManager的简单使用,
  3. 批量反编译Android(安卓)XML文件Python脚
  4. 如何开发Android(安卓)Maps
  5. Android(安卓)Studio之导入外部jar包
  6. 关于android工程中R.java不自动生成的问
  7. android activity开发文档翻译 - 1 - 基
  8. Android中的Context
  9. Android推送通知指南
  10. Ubuntu 10.04下Android开发环境的搭建