How to center a textview inside a linearlayout

前端 未结 11 2158
死守一世寂寞
死守一世寂寞 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:51

    Set android:gravity="center" attribute for TextView inside linear layout and keep the text view's height and width as wrap_content.

    This Solution worked for me.

提交回复
热议问题