سؤال

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