Hi, is there a way to have multiple lines of text in UILabel like in the UITextView or should I use the second one instead?
Thanks.
Hi, is there a way to have multiple lines of text in UILabel like in the UITextView or should I use the second one instead?
Thanks.
I found a solution.
One just has to add the following code:
textLabel.lineBreakMode = UILineBreakModeWordWrap;
textLabel.numberOfLines = 0;
I'm not sure how to write the text in interface builder. So just open up TextEdit and enter the text you want and copy and paste it into the text of the UILabel in interface builder.
Once that's done, open up the inspector and you should notice to the right of Alignment is "# lines" set that to 0, to make it check how many lines needed.
In IB, set number of lines to 0 (allows unlimited lines)
When typing within the text field using IB, use "alt-return" to insert a return and go to the next line (or you can copy in text already separated out by lines).