2009-06-01 25 views

回答

1

UITableView可以发送消息:deleteRowsAtIndexPaths:withRowAnimation: withRowAnimation参数确定将在删除单元格时使用的动画类型。

我不知道这些动画中是否有任何动画完全符合错过/全部功能。如果他们不这样做,我猜你必须设置一个动画来消除单元格的高度,然后才能删除它们。

2

deleteRowsAtIndexPaths:withRowAnimation:和insertRowsAtIndexPaths:withRowAnimation:将为您提供动画。

如果您需要执行更复杂的操作(插入和删除),则会启动一个块。类似于UIView动画块:

[tableView beginUpdates]; 

//add and delete 

[tableView endUpdates]; 

请记住,您需要更新模型以反映表中的更改。