开发者

How to limit the delete option for first row in UITableView

HI In my appliacatio开发者_JAVA百科n I want deletion control button will not work for first row except for all other rows.

Please can anybody tell me how it would be possible.

Thanks


Implement editingStyleForRowAtIndexPath method in table delegate and return style value depending on cell's index:

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
           editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
    //Disable editing for 1st row in section
    return (indexPath.row == 0) ? UITableViewCellEditingStyleNone : UITableViewCellEditingStyleDelete;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜