Android XML属性比较多,全部记住不太现实,用的时候查文档是一条途径。如何迅速找到所需的XML属性?

Android包下面android.R.styleable类包含下面所有组件相关的XML属性。

如:

public static final int[] LinearLayout_Layout

Since:

Attributes that can be used with a LinearLayout_Layout.

Includes the following attributes:

Attribute Description
Standard gravity constant that a child can supply to its parent.
Specifies the basic height of the view.
Specifies the basic width of the view.

值得一提的是:android:layout_gravity属性在TextView里面也能用。如设置TextView居中就需要这样:

android:layout_gravity="center_horizontal'.

可是TextView并没有继承android.widget.LinearLayout.LayoutParams。

这说明他们之间的属性是通用的。

转载From:http://blog.csdn.net/zhangqijie001/article/details/5870261

更多相关文章

  1. 【转】详解android:scaleType属性
  2. 相对布局的属性
  3. android 属性个人收集 android:visibility
  4. 关于visibility的属性值visible,invisible,gone的区别
  5. Android界面基本属性
  6. 对android LinearLayout中layout_weight属性使用
  7. Android(4)---Android 控件布局常用属性

随机推荐

  1. Android利用Soap读取WebService并且解析X
  2. [Android]Service和Activity双向通信的两
  3. dalvik.vm 属性与android:largeHeap
  4. c++服务器与android客户端进行文件传输功
  5. Android开发学习---使用XmlPullParser解
  6. Android从零开始(十六)
  7. Android碎知识点以及正则表达式
  8. Android(安卓)开发之 ClipboardManager
  9. android Service深入详解
  10. Android(安卓)TextView自适应文字大小