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:
The algorithm would be roughly:
String
width (with Paint.measureText
or something)TextView
) width, just use itString
width by container to know how many "\n"
to entermeasureText
if the font is not monospace)Probably will require some adjustments like using container width by some small percent smaller than real.