How to align linearlayout to vertical center?

后端 未结 8 1770
你的背包
你的背包 2020-12-08 12:43

I\'m trying to align LinearLayout\'s vertical center which shows following pic (skycolor border) to delete button\'s vertical center.

so I set the gravity of id:grou

8条回答
  •  眼角桃花
    2020-12-08 13:42

    Change orientation and gravity in

    
    

    to

    android:orientation="vertical"
    android:layout_gravity="center_vertical"
    

    You are adding orientation: horizontal, so the layout will contain all elements in single horizontal line. Which won't allow you to get the element in center.

    Hope this helps.

提交回复
热议问题