How to align LinearLayout at the center of its parent?

前端 未结 14 2026
北荒
北荒 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 09:51

    @jksschneider explation is almost right. Make sure that you haven't set any gravity to parent layout, and then set layout_gravity="center" to your view or layout.

提交回复
热议问题