使用动画以编程方式重新排序 UITableView 行 [英] Reordering UITableView rows programmatically with animation
问题描述
我非常了解如何使用用户的重新排序控件"重新排序 UITableView
行.
I very much know how to reorder UITableView
rows using "reorder Control" by the user.
通过实现 UITableView
委托和数据源方法,就像 在苹果文档中提供.
By implementing UITableView
delegates and datasource methods as it is provided in apple documentation.
但我希望以编程方式获得相同的功能.
But I want the same functionality programmatically.
在更新行/单元格的情况下我需要这个我想根据更新时间或其他一些标准重新排序.
I need this in the scenario when a row/cell is updated I want reordering according to that update time or some other criteria.
我已经在这个购物清单应用中看到了这个功能.
I've seen this functionality in this grocery list app.
我想用动画重新排序.
推荐答案
查看 UITableView 参考.
Check out the UITableView reference.
您可能想要使用这些方法:
You may want to use these methods:
– beginUpdates
– endUpdates
– insertRowsAtIndexPaths:withRowAnimation:
– deleteRowsAtIndexPaths:withRowAnimation:
– insertSections:withRowAnimation:
– deleteSections:withRowAnimation:
这篇关于使用动画以编程方式重新排序 UITableView 行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!