Uniform text wrapping in TextView

前端 未结 6 1438
隐瞒了意图╮
隐瞒了意图╮ 2021-01-19 06:34

I need nice text wrapping in TextView, especially for text in headers.

Text wrapping for TextView might look like this, where the last word is in new line:



        
6条回答
  •  既然无缘
    2021-01-19 07:28

    If you know whats the text in advance (I means if its a hard coded text), you can fix the width of TextView in dp, so that it wraps up properly, or else you may also use android:ems to fix the maximum number of characters in a line. So your TextView can be:

    
    

    OR

      
    

    I hope this helps!

提交回复
热议问题