我无法找到解决方法。是否可以使用左滑动来删除选项,还可以使用编辑和删除。左滑动删除和编辑,删除
我有导航栏左侧的编辑按钮。
self.navigationItem.leftBarButtonItem = self.editButtonItem;
和commitEditingStyle方法如下
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
//delete code here
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
使用在此之后,没有被检测到向左扫动的。唯一的删除方法似乎是进入编辑模式并从那里删除。 帮助将不胜感激。
我是一个新手,所以请去容易与我:)
是。除了您发布的内容中没有删除代码之外,似乎是什么问题。 – Jordan 2011-04-12 08:21:03
现在左侧刷卡根本没有被检测到。我可以通过去编辑模式和删除那里删除..但不使用左滑动:( – Neelesh 2011-04-12 08:23:41
顺便说一句:如果你不使用UINavigationController,你应该只使用NavigationBar的左侧的EditButton。无论哪种方式,它是总是更好地坚持准则,并将EditButton放置在导航栏的右侧 – Amandir 2011-04-12 08:26:48