7

I am in the process of trying to convert a desktop app to Android - and am struggling with some very basic stuff.

When I specify a layout including a textview that holds a sizable amount of text wrap_content seems to arbitrarily break in the middle of a word and I can not find any documentation indicating this can be controlled.

double-beep
  • 5,031
  • 17
  • 33
  • 41
Rudi Diezmann
  • 71
  • 1
  • 2
  • Are you seeing this exhibited on an actual device as well as the emulator in addition to the graphical representation of the xml view? – Norman H Mar 01 '12 at 05:11

2 Answers2

0

Try useing Ellipsize property of TextView.

"If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle"

Asaf Pinhassi
  • 15,177
  • 12
  • 106
  • 130
0

Just posting this since none of the other solutions worked for me.

I had copied and pasted some text from online and I didn't realize it had weird spacing characters in that caused the text to wrap mid-word rather than at whitespace.

Here is the nasty character " " that looks like a space but isn't actually a space. I did a find and replace for this character and that solved my problem.

Lifes
  • 1,226
  • 2
  • 25
  • 45