开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜