UITableView Cell设置为禁止点击

来源:互联网 发布:课堂点名软件 编辑:程序博客网 时间:2024/05/01 22:04

方法一:

cell.userInteractionEnabled =NO;

方法二:

_tableView.allowsSelection=NO;

方法三:

1、cell.selectionStyle =UITableViewCellSelectionStyleNone;

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

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


0 0