重写下面代码
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
if (selected) {
self.backgroundColor = [UIColor colorWithWhite:1.000 alpha:0.300];
} else {
self.backgroundColor = [UIColor clearColor];
}
}
然后设置
cell.selectionStyle = UITableViewCellSelectionStyleNone;
如果想点一下cell 消失呢
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
if (highlighted) {
self.backgroundColor = [UIColor redColor];
}else {
self.backgroundColor = [UIColor whiteColor];
}}