views:

902

answers:

1

I have a tableivew with a bunch of cells and I am trying to get the uilabel to display more than 3 lines. I set the linebreakmode and the numberoflines appropriately, but it's still not displaying more than three lines. Any suggestions? The table cell automatically adjusts its height to accomodate the number of chars/lines, but the text shows three lines and then an ellipse (when you click the cell it goes to another view which shows the full text.

Below is the code that I have to create and display the UILabel:

   self.commentLabel = [self newLabelWithPrimaryColor:[UIColor blackColor] selectedColor:[UIColor whiteColor] fontSize:12.0 bold:YES];
 self.commentLabel.textAlignment = UITextAlignmentLeft; // default
 self.commentLabel.lineBreakMode = UILineBreakModeWordWrap;
 self.commentLabel.numberOfLines = 0; // no limit to the number of lines 
 [myContentView addSubview:self.commentLabel];
 [self.commentLabel release];

I would like the entire comment to be displayed in the table cell.

+1  A: 

Seems like the rectangle of the label is too small to fit all the text...You must make the rectangle bigger in order for it to not display the ellipses and display the whole text

Daniel
Yes - I was resizing the tablecell, but not the UILabel. I went to the method that was creating the Label and created a math function to set the height based on the number of characters in the comment. Thanks Daniel.
Miriam Roberts