moveRowAtIndexPath没有删除button
我需要在UITableview
具体帮助- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
。
在这个如果我设置[tableView setEditing:YES animated:YES];
然后表包含删除和moveCellfunction。 但我只需要moveCellfunction。 我不想删除类别。
喜欢这个,
有没有办法做到这一点? 帮助者表示赞赏。
只要使用这个方法,单元格就没有编辑控制了:
- (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; }