iOS UITableViewCell选中时,子视图背景颜色受影

2017-05-09  本文已影响38人  觉醒的苍红之刃

效果预览

效果图

实现

在该cell的layoutSubviews方法中再次设置对应子视图的背景颜色

实现代码

override func layoutSubviews() {
  super.layoutSubviews();
  unreadLabel?.backgroundColor = UIColor.hx_color(withHexRGBAString: "#FF5B45");
}
- (void)layoutSubviews {
    [super layoutSubviews];
    _unreadLabel.backgroundColor = [UIColor hx_colorWithHexRGBAString:@"#FF5B45"];
}
上一篇 下一篇

猜你喜欢

热点阅读