我知道这听起来像是一个愚蠢的问题,但我到处都看过。我怎样才能做到这一点?
我知道如何使用 swype-to-delete 方法来执行此操作,但是我如何在该函数之外执行此操作?
请发布一些代码示例。
Thanks!
Coulton
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[self.tableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[self.tableView endUpdates];
insertIndexPaths
是要插入到表中的 NSIndexPaths 数组。
deleteIndexPaths
是要从表中删除的 NSIndexPaths 数组。
索引路径的数组格式示例:
NSArray *insertIndexPaths = [[NSArray alloc] initWithObjects:
[NSIndexPath indexPathForRow:0 inSection:0],
[NSIndexPath indexPathForRow:1 inSection:0],
[NSIndexPath indexPathForRow:2 inSection:0],
nil];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)