android线性布局 gravity 属性 与 layout_gravity

LinearLayout 是view的子类

RelativeLayout 

AdapterView --ListView是其子类

AdapterView --GridView是其子类

参考文档  https://developer.android.google.cn/reference/android/widget/AdapterView

ListView https://developer.android.google.cn/reference/android/widget/ListView

  线性布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" //指定命名空间
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</LinearLayout>

gravity            用于设置该控件中内容相对于该控件的对齐方式

layout-gravity  用于设置该控件相对于父控件的对齐方式

gravity属性的值

猜你喜欢

转载自blog.csdn.net/weixin_41069726/article/details/86538967