UISegmentControl 和 UITableViewController 动画
-
06-09-2019 - |
题
当用户在 UISegmentControl 中的段之间进行更改时,如何为“删除 tableviewitems”设置动画?
该行为应类似于电话应用程序中的“未接/所有”呼叫。
没有正确的解决方案
其他提示
在deleteRowsAtIndexPaths:withRowAnimation:和insertRowsAtIndexPaths:withRowAnimation:将提供动画你
如果您需要执行更复杂的操作(插入和删除),则开始一个块。类似于一个UIView动画块:
[tableView beginUpdates];
//add and delete
[tableView endUpdates];
请记住,您将需要更新模型,以反映在表中的变化。
UITableView可以发送消息: deleteRowsAtIndexPaths:withRowAnimation:withRowAnimation 参数确定删除单元格时使用的动画类型。
我不知道这些动画是否与错过的/所有功能完全匹配。如果不这样做,我猜你必须设置一个动画来折叠单元格的高度,然后再删除它们。
不隶属于 StackOverflow