标签:
系统自定义的点击背景有时间觉得效果不好想换个
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; if (selected) { self.backgroundColor = [UIColor redColor]; }else { self.backgroundColor = [UIColor whiteColor]; } }
如果你发现时上面的,0-0那肯定没成功啊,为什么呢?
打开层级,可以看到,原来在下面,这样就简单了,只需要在初始化cell后加上这么一段代码
cell.selectionStyle = UITableViewCellSelectionStyleNone;
效果图:
-0-成功了~~~~~~~~~~~~~~~~~~~
标签:
原文地址:http://www.cnblogs.com/hxwj/p/4731959.html