开发者

Centering Text In A TextView

开发者 https://www.devze.com 2023-01-18 02:07 出处:网络
I have a TextView that has text Dynamically Added to it.My problem is that when I use gravity for the centering the text, it doesn\'t move because the width is set to \"wrap_content\".

I have a TextView that has text Dynamically Added to it. My problem is that when I use gravity for the centering the text, it doesn't move because the width is set to "wrap_content".

What should I do to re开发者_StackOverflowsolve this issue?


You're going to have to set the width to something other than "wrap_content".


I know the answer has already been accepted here but you could have also set the layout_gravity to center too and then wrap_content would still work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号