iOS基础

点击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;
}

上一篇 下一篇

猜你喜欢

热点阅读