Textview Gravity not working properly in android

后端 未结 5 846
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 18:44

What\'s wrong with my code, I\'m trying to display my TextView named \"invalid\", in different locations (left,right,center), but the gravity (left,right,center) w

5条回答
  •  误落风尘
    2021-02-13 19:29

    You set this text view a width of "wrap_content" it means, what ever the text is, the view take the size of the text.

    and in the LinearLayout , the default gravity (used here) is 'center'

    you should try this :

    
    

提交回复
热议问题