如何在不使用"setEditing"方法删除控件的情况下启用UITableViewCell重新排序?

4
当我使用 [tableview setEditing:YES animated:YES]; 来启用 UITableViewCell 的重新排序时,删除控件也会出现。如何防止这种情况发生?
2个回答

15

0
将此方法添加到您的代码中:
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return NO;
}

此选项禁用重新排序。 - dwery

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接