TextView horizontal center in RelativeLayout

前端 未结 6 1318
一向
一向 2021-02-01 12:04

In my app screen, i want to show Heading as horizontally center. I tried with below layout xml codes




        
6条回答
  •  逝去的感伤
    2021-02-01 12:33

    android:gravity controls the appearance within the TextView. So if you had two lines of text they would be centered within the bounds of the TextView. Try android:layout_centerHorizontal="true".

提交回复
热议问题