2

When using UITableViewCell with UITableViewCellStyleValue1 style the textLabel.text is being truncated when detailTextLabel is pretty long.

static NSString *CellIdentifier = @"Cell";
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];

cell.textLabel.text = @"Publisher";
cell.detailTextLabel.text = @"This Is A Very Long String";

So the question is how to force "Publisher" to be displayed without being truncated regarldess length of detailTextLabel?

P.S. I am new in this community so I couldn't post images which could clarify better the problem. Sorry for that...

Joshua
  • 1,974
  • 2
  • 23
  • 39

2 Answers2

4

Have you tried [cell.detailTextLabel setNumberOfLines:0]; Maybe it works.

Behlül
  • 3,412
  • 2
  • 29
  • 46
0

If you're actively changing the text of a cell then it may be truncated because the label is not being expanded despite having lots of room. You can call [cell setNeedsLayout] after changing the text to fix that particular issue.

Craig Gidney
  • 17,763
  • 5
  • 68
  • 136