I am using a UITableView
on an iPad and for some reason the UITableViewCell.textLabel
's text is getting truncated even though there's plenty of space to display the text. I tried all of the following, none of which fixed it:
[cell sizeToFit]
after setting the text[cell.textLabel setNumberOfLines:0]
and [cell.textLabel setLineBreakMode:NSLineBreakByWordWrapping]
I haven't yet tried subclassing UITableViewCell and setting the frame explicitly in the layoutSubviews method. Trying to avoid that as I feel like there should be a better solution. I also don't want to resize the text--there is plenty of space to fit the text at the full font size.
u set set textLabel number of line 0
cell.textLabel.numberOfLines=0;
cell.textLabel.lineBreakMode=UILineBreakModeWordWrap; or NSLineBreakByWordWrapping;
hope it help you
Set the "setNumberOfLines" property of the label to wrap the text to required number of lines. If you don't want the "..." at the end of the text if it is too long then use
cell.textLabel.lineBreakMode = UILineBreakModeWordWrap; or NSLineBreakByWordWrapping for ios 6 or more
Try to set height and width of textlable and tableviewcell dynamicaly refer this link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With