reloadTable after animated row deletion

后端 未结 1 1884
春和景丽
春和景丽 2021-01-26 16:33

I have a table view with cells that can be deleted. When a cell is deleted, I would like to display a deletion animation such as UITableViewRowAnimationFade. The

1条回答
  •  再見小時候
    2021-01-26 16:54

    You could also use NSTimer with the same delay (although unneeded, -performSelector:withObject:afterDelay: works fine).

    Another option would be to loop through the cells after deletingCell (path) and redraw them, or add the index paths to an array and call reloadRowsAtIndexPaths:withRowAnimation: as shown below. Then you could also use the UITableViewRowAnimationFade

    - (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
    

    0 讨论(0)
提交回复
热议问题