How do I only enable re-ordering for UITableViewController?
I have a bunch of UITableViewCell's in my UITableViewController. When I set editing to YES, it automatically enab开发者_如何学编程les deletion of each cell. How do I disable the delete feature? I only want to let the user reorder the cells.
Try:
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:
(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}
It controls whether a minus, a plus or nothings shows up
Set the cells' editingStyle to UITableViewCellEditingStyleNone and -showsReorderControl to YES. In your -tableview:cellForRowAtIndexPath: method:
[myCell setShowsReorderControl:YES];
精彩评论