- 在linearlayout 布局中,设置其子控件居中,使用gravity
- 对于RelativeLayout 布局,使用gravity设置子控件居中,没有作用。
但是可以在其子控件中,设置android:layout_centerInParent="true"
实现居中显示
(其他居中:
android:layout_centerVertical="true"
)
android:layout_centerHorizontal="true"
RelativeLayout布局中linearlayout布局居中
最新推荐文章于 2023-08-15 16:44:12 发布