I have a UITableView using the UITableViewCellStyleSubtitle style. I have also increased the cell height by using

cell.textLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.textLabel.numberOfLines = 0;

and then calculating the desired height in heightForRowAtIndexPath. However, when the user slides the 'delete' button in, the text in the cell stretches out and overlaps the upper and lower edges of the cell. How can I truncate the text like it would if I used the default cell style? (or alternatively, could i change the cell height again possibly?)

有帮助吗?

解决方案

The answer was

cell.textLabel.numberOfLines = textLabelheight/textLabelFontSize;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top