LinearLayout常用属性
android:orientation
—-该属性决定子类控件的排布方式,包括垂直(vertical)和水平(horizontal)
android:gravity
—-该属性决定子类的位置
1. center_vertical 垂直居中
2. center_horizontal 水平居中
3. center 居中
4. right 子类控件位于当前布局的右边
5. left 子类控件位于当前布局的左边
6. bottom 子类控件位于当前布局的下面
该属性值可以结合使用,例如
android:gravity="center |bottom "
子类控件在LinearLayout中常用属性
android:layout_gravity
—-指本身在当前父容器中的一个XY位置
属性值与LinearLayout中相同
android:layout_weight
—-指本身控件所占当前父容器的比例