我想知道是否有办法让用户能够重新排列(移动)单个TableViewCells的方式使UITableView可编辑,但不显示“Remove-Cell”特征。
谢谢你的帮助
SAM
答案 0 :(得分:21)
您是否尝试过实现editingStyleForRowAtIndexPath方法并返回UITableViewCellEditingStyleNone?
答案 1 :(得分:0)
根据您的要求更改 if condition
- (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
// in below if your write your condition on which delete is enable or disable
if ([[friednListArr objectAtIndex:indexPath.row][@"id"] isEqualToString:user.userId]) {
return UITableViewCellEditingStyleNone;
}
else{
return UITableViewCellEditingStyleDelete;
}
}