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(安卓)EditText控件使用
  2. android一些属性的总结
  3. ListPreference之entries和entryValues
  4. android中常见的四种布局
  5. ListPreference之entries和entryValues
  6. Android(安卓)控件系列: GridView 的简单使用
  7. Android入门(2) 基本控件介绍、4种布局
  8. Android初级工程师面试题答案——Android题型
  9. 修改光标颜色

随机推荐

  1. Android各版本特性比较
  2. Android 控件之Spinner
  3. Build/Environmen
  4. Android 网页抓取(实现新闻客户端)
  5. Android Looper和Handler分析 .
  6. Android上使用Box2d
  7. TextView/EditText大全
  8. Android学习心得之四——Android NDK的理
  9. Android(安卓)手绘 - 支持保存为图片
  10. Android Intent的使用