在我的 iphone 应用程序上,我有一个处于编辑模式的 UITableView,在该模式下,用户只能重新排序行,没有删除权限。

那么有什么方法可以隐藏TableView中的“-”红色按钮。请告诉我。

谢谢

最佳答案

这是我的完整解决方案,没有单元格的缩进(0left align)!

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
    return UITableViewCellEditingStyleNone;
}

- (BOOL)tableView:(UITableView *)tableview shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
    return NO;
}


- (BOOL)tableView:(UITableView *)tableview canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}

关于ios - 有没有办法在编辑 UITableView 时隐藏 "-"(删除)按钮,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3020922/

10-14 21:38
查看更多