0

How to wrap texts in UITableViewcell on iPhone?

ebaccount
  • 5,031
  • 11
  • 42
  • 47
  • See [this question](http://stackoverflow.com/questions/129502/how-do-i-wrap-text-in-a-uitableviewcell-without-a-custom-cell). – Ian Henry Dec 05 '09 at 21:46

2 Answers2

1

Have you looked at the lineBreakMode property on UITableViewCell?

lineBreakMode

The mode for for wrapping and truncating text in the cell. (Deprecated. Instead set the line-break mode attribute of the UILabel objects assigned to the textLabel and detailTextLabel properties.)

@property(nonatomic) UILineBreakMode lineBreakMode

Discussion

For further information, see the UILineBreakMode constants described in NSString UIKit Additions Reference. The default value is UILineBreakModeTailTruncation.

Jasarien
  • 57,879
  • 30
  • 158
  • 187
1

You would also need to set the number of lines for the text label.

Example

[cell.textLabel setNumberOfLines:2];
geekydevjoe
  • 108
  • 1
  • 7