Android(安卓)XML属性在文档中的位置
16lz
2022-03-05
Android XML属性比较多,全部记住不太现实,用的时候查文档是一条途径。如何迅速找到所需的XML属性?
Android包下面android.R.styleable 类包含下面所有组件相关的XML属性。
如:
public static final int[] LinearLayout_Layout
Since: API LevelAttributes 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。
这说明他们之间的属性是通用的。
更多相关文章
- Android之ListView中的分割线和行高
- Android的CheckBox控件的点击效果布局文件
- android自定义滚动条(ScrollBar)样式
- LinearLayout && RelativeLayout 常用属性
- 关于android:configChanges的属性
- android 中的 edittext属性大全
- Android(安卓)SDK 安装中组件的离线安装方法 (share)
- Android学习笔记:androidmanifest.xml 高级属性
- android 拨号盘Contact模块讲解(四)