How to align LinearLayout at the center of its parent?

前端 未结 14 2034
北荒
北荒 2020-12-04 09:29

I\'ve looked through numerous similar questions here at SO, but nothing helps. I have a hierarchy of different nested layouts, all have android:layout_width=\"fill_par

14条回答
  •  借酒劲吻你
    2020-12-04 10:02

    this worked for me.

    
    .
    .
    .
    android:gravity="center"
    .
    .>
    
    
    

    so you're designing the Linear Layout to place all its contents(TextView and Button) in its center and then the TextView and Button are placed relative to the center of the Linear Layout

提交回复
热议问题