Recalculate the height of a custom UITableViewCell when the Delete button appears

I created a subclass of UITableViewCell that contains a multi-line shortcut. In TableViewDelegate, I override -setEditing: to recalculate the height of the label with a shorter width when a circular widget is visible. It still works.

However, when this circular widget is displayed and the "Delete" button appears, the cell seems to receive a relay (the label becomes smaller), but the cell height is not recounted. Setting a breakpoint in -heightForRowAtIndexPath: indicates that such an event does not -heightForRowAtIndexPath: pressing the circular widget / new button that appears. How can I get tableView to recalculate cell height in this case?

+4
source share
1 answer

Try an empty update block, for example:

 [self.myTable beginUpdates]; [self.myTable endUpdates]; 

It updates row heights (among other things).

+2
source

Source: https://habr.com/ru/post/1379866/


All Articles