美文网首页
cell点击相关和点击后背景颜色

cell点击相关和点击后背景颜色

作者: 漂泊的飞鸟 | 来源:发表于2017-02-21 14:19 被阅读0次

tableView.allowsSelection = NO;//禁止cell选中

cell.userInteractionEnabled = NO;//这个设置后cell不可点击,cell里边的控件不可点击。

cell.contentView.userInteractionEnabled =NO;//这个设置后cell可以点击,但cell里边的控件不可点击。

cell.selectionStyle = UITableViewCellSelectionStyleNone; //这个设置后cell可以点击,点击后没有颜色

设置cell的选中后背景颜色

cell.selectedBackgroundView= [[UIViewalloc]initWithFrame:cell.frame];

cell.selectedBackgroundView.backgroundColor= [UIColorredColor];

相关文章

网友评论

      本文标题:cell点击相关和点击后背景颜色

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