I have a grouped UITableView with a few sections. The text in some of the cells can get quite long, I was wondering how I could make the text word-wrap?
eg
textLabel.numberOfLines = 0;
You can set this to a fixed number of lines if you prefer. It may be a good idea to set the lineBreakMode, and you will probably need to implement:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
using:
NSString sizeWithFont:constrainedToSize:
You'll have the specify the number of lines the text will use. Setting it to zero will wrap it automatically.
cell.textLabel.numberOfLines=0; // line wrap
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