1

I have a RSS feed reader app which each cell collets a title from an element in an XML from RSS feed apple website. Now the titles are very long so what I wanted to do was increase the size of the each cell using:

 -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

return 80;
  }

to make the title come in two or more lines and spread out but the text continues to go on straight and cut off. How can i fix this?

user973985
  • 281
  • 2
  • 7
  • 14

2 Answers2

5

It's as simple as setting the numberOfLines property on the UILabel and the lineBreakMode property to allow the UILabel to auto-support multiple lines of text.

Warkst
  • 4,789
  • 3
  • 30
  • 39
1

You only set the cell height, but the UILabel is still a single line label. To change that see here.

Community
  • 1
  • 1
thvanarkel
  • 1,591
  • 11
  • 19