How to truncate text of UITableViewCellStyleSubtitle cell when 'Delete' slides in?
-
28-10-2019 - |
문제
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;
제휴하지 않습니다 StackOverflow