How to align linearlayout to vertical center?

后端 未结 8 1765
你的背包
你的背包 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:44

    Use android:weightSum property to the parent LinearLayout and give value 3. Then in the children LinearLayout use android:layout_weight 2 and 1 respectively. Then in the First Chil LinearLayout use android:layout_gravity="center_vertical". As shown in the following code

    
    
                        
                            
                              
                        
                        
                            

提交回复
热议问题