RelativeLayout布局中linearlayout布局居中

来源:互联网 发布:Tensorflow 字符识别 编辑:程序博客网 时间:2024/05/21 19:28
  1. linearlayout 布局中,设置其子控件居中,使用gravity
  2. 对于RelativeLayout 布局,使用gravity设置子控件居中,没有作用。
    但是可以在其子控件中,设置android:layout_centerInParent="true"实现居中显示
    (其他居中:
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
0 0
原创粉丝点击