Android: do not break a string in TextView String elements

I would like to avoid line breaks in specific parts of the line.

Say we have this line:

Speed (m/s) 

The ideal will either not jump at all, but have a complete line in one line or, if a jump is necessary, as follows:

 Speed (m/s) 

What I want to avoid is:

 Speed (m/ s) 

Any ideas?

+7
android string textview newline
source share
2 answers

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

+8
source share

Try this (just an idea, not tested):

0
source share

All Articles