views:

228

answers:

2

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.

+3  A: 

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

Jacek
+2  A: 
 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.

Noah Witherspoon