How to center a textview inside a linearlayout

前端 未结 11 2140
死守一世寂寞
死守一世寂寞 2020-12-15 03:05

I have the following layout i\'d like to make the textview appear in the center and middle of the view. How can i acheive this?

I\'ve tried adjusting the various gra

11条回答
  •  借酒劲吻你
    2020-12-15 03:58

    Set width of your textview to wrap_content, and set your LinearLayout to

    android:gravity="center_horizontal"
    

提交回复
热议问题