I have dynamic text in a label with plenty of room around it. Since there is room, it would be great if the text could wrap in addition to autoshrinking.
Asked
Active
Viewed 60 times
0
-
see http://stackoverflow.com/questions/4626548/how-to-make-uilabel-wordwrap – Emmanuel Feb 13 '14 at 09:18
1 Answers
1
You can apply any of these 2 solutions
1.Set numberOfLines To 0 and make larger height of your label then text automatically wrap.
2.you can dynamically calculate height of label on the basis of length of string with function sizeWithFont.

rahul
- 178
- 5
-
Thanks! I wouldn't have thought to set the number of lines to zero. But now that you point it out, I guess it was right in front of me. Works exactly like I need it to! – pixelfairy Feb 13 '14 at 17:22