重写-(void)setSelected:(BOOL)selected animated:(BOOL)animated{
[super setSelected:selected animated:animated];
if (selected) {
self.titlelable.textColor = THEME_COLOR;
}else{
self.titlelable.textColor = DEFAULT_COLOR;
}
}
在这个方法中可以通过选中与否动态的改变文字颜色等等;
下面是单独改变cell选中时的背景颜色为白色:
self.contentView.backgroundColor = [UIColor clearColor];
UIView *aView = [[UIView alloc]initWithFrame:self.contentView.frame];
aView.backgroundColor = [UIColor whiteColor];
self.selectedBackgroundView = aView;