UITableView Cell设置为禁止点击

作者: 加菲猫哈哈哈哈 | 来源:发表于2018-07-21 13:39 被阅读1次

方法一:

cell.userInteractionEnabled =NO;

方法二:

_tableView.allowsSelection=NO;

方法三:

1、cell.selectionStyle =UITableViewCellSelectionStyleNone;

2、didSelectRowAtIndexPath中不实现点击动作。

注意:如果cell上有添加Button,方法一和方法二Button的点击动作也会被忽略掉,方法三可以避免这个问题。

相关文章

网友评论

    本文标题:UITableView Cell设置为禁止点击

    本文链接:https://www.haomeiwen.com/subject/wgdhmftx.html