Question

I am new to iphone development .I want to wrap up the text in the label.I want to wrap up to a particular position in the label.Thanks.

Was it helpful?

Solution

 theLabel.lineBreakMode = UILineBreakModeWordWrap;
 theLabel.numberOfLines = 0;

That'll let it wrap an arbitrary number of lines. If you want to limit them, and have it truncate with a “...”, then set the numberOfLines property to that value.

OTHER TIPS

Set "Line breaks" in Interface Builder ( http://drp.ly/d3K65 ) to "Word Wrap" and increase height of the UILabel.

You can do the same thing (or even more complex) in the code, see UILabel reference http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UILabel_Class/Reference/UILabel.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top