当我使用
[tableview setEditing:YES animated:YES];
来启用 UITableViewCell 的重新排序时,删除控件也会出现。如何防止这种情况发生?[tableview setEditing:YES animated:YES];
来启用 UITableViewCell 的重新排序时,删除控件也会出现。如何防止这种情况发生?在表视图代理中实现 -tableView:editingStyleForRowAtIndexPath:
方法,并返回 UITableViewCellEditingStyleNone
。
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return NO;
}