开发者

Hide/Disable edit button on select UITABLEVIEW cells?

开发者 https://www.devze.com 2022-12-11 15:16 出处:网络
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

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

精彩评论

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