在自定义cell中使用如下方法:
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
UIColor *backgroundColor = self.subView.backgroundColor;
[super setHighlighted:highlighted animated:animated];
self.subView.backgroundColor = backgroundColor;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
UIColor *backgroundColor = self.subView.backgroundColor;
[super setSelected:selected animated:animated];
self.subView.backgroundColor = backgroundColor;
}