展会信息港展会大全

Android XML属性在文档中的位置
来源:互联网   发布日期:2016-01-13 21:57:52   浏览:1556次  

导读:Android XML属性比较多,全部记住不太现实,用的时候查文档是一条途径。如何迅速找到所需的XML属性?Android包下面android.R.styleable类包含下面所有组件相关的XML属性。如:public static final int[]Linea......

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

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

如:

public static final int[] LinearLayout_Layout

Since: API Level

Attributes that can be used with a LinearLayout_Layout.

Includes the following attributes:

Attribute

Description

android:layout_gravity

Standard gravity constant that a child can supply to its parent.

android:layout_height

Specifies the basic height of the view.

android:layout_weight

android:layout_width

Specifies the basic width of the view.

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

android:layout_gravity="center_horizontal'.

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

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

赞助本站

人工智能实验室

相关热词: XML 属性 位置

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港