Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: avoid breaking line in TextView String parts [duplicate]

I would like to avoid breaking lines in specifical parts of the String.

Let's say we have this String:

Speed (m/s)

The ideal would be either not jumping at all and having the full String in one line, or, if the jump is needed, in this way:

Speed
(m/s)

What I want to avoid are thing like this:

Speed (m/
s)

Any ideas?

like image 597
apascual Avatar asked Aug 27 '13 17:08

apascual


1 Answers

Try to use non-breaking space between the Speed and "(m/s)". The Unicode no-break space character (\u00A0) should work for TextView.

like image 101
YX1990 Avatar answered Dec 11 '22 00:12

YX1990