如何启用UITableViewCell重新sorting而不删除与“setEditing”方法的控制?
当我使用[tableview setEditing:YES animated:YES];
要启用UITableViewCell重新sorting,删除控制也会出现。 我怎样才能防止呢?
实现-tableView:editingStyleForRowAtIndexPath:
在表视图中委托并return UITableViewCellEditingStyleNone
。
将此方法添加到您的代码:
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the specified item to be editable. return NO; }