点击cell时subView背景色消失
2016-06-28 本文已影响43人
伏特加
在自定义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;
}