开发者

Hide/Disable edit button on select UITABLEVIEW cells?

I have a UITABLEVIEW where I want to show the delete function for only certain cells (that is, certain cells are user deletable certain cells aren't). As far as I can tell, seteditable: is only set at the table level. Is there a way to override this or hide the delete button on certain 开发者_StackOverflowcells?


You should implement

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath

in tableview delegate. There you can return appropriate editing style for your cells: UITableViewCellEditingStyleDelete for deletable cells, UITableViewCellEditingStyleNone for others

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜