1.1
match_parent表示让当前控件的大小等同于父控件,父控件多大,他就多大。
wrap_content 表示这个控件的大小和内容大小刚好。
android:layout_width=“match_parent”
android:layout_height=“wrap_content”
1.2
vertical 表示垂直布局,只有水平方向的设置才起作用,垂直方向的设置不起作用。即:left,right,center_horizontal 是生效的。
horizontal 表示水平布局,只有垂直方向的设置才起作用,水平方向的设置不起作用。即:top,bottom,center_vertical 是生效的。
android:orientation=“vertical”
android:orientation=“horizontal”
1.3
layout_marginTop 指定该属性所在控件距上部最近控件的最小值;
layout_marginBottom 指定该属性所在控件距下部最近控件的最小值;
layout_marginLeft 指定该属性所在控件距左边最近控件的最小值;
layout_marginRight 指定该属性所在控件距右边最近控件的最小值。
margin是距离父控件的间距
padding是控件内容距离空间四个边界的距离
android:layout_marginTop=“20dp”
1.4
TextView的文字内容居中显示
android:gravity=“center”
1.5
layout_weight 自动分割比例
android:layout_width=“0dp”
android:layout_weight=“1”