在給cell上的子視圖設(shè)置backgroundColor后,當點擊cell時會發(fā)現(xiàn)子視圖的背景色消失了,解決這個問題只需重寫cell的下面的這兩個方法就可以了。
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
self.noteViewTop.backgroundColor = [UIColor blackColor]; //設(shè)置子視圖背景色
}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
self.noteViewTop.backgroundColor = [UIColor blackColor]; //設(shè)置子視圖背景色
}