美文网首页
IOS开发-选中某行Cell的时候,添加的分隔线消失的问题

IOS开发-选中某行Cell的时候,添加的分隔线消失的问题

作者: swluan | 来源:发表于2017-02-27 12:30 被阅读0次

重写-setSelected:animated:和 -setHighlighted:animated:方法

@property (nonatomic, weak) UIView *lineview;

  • (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
    {
    [super setHighlighted:highlighted animated:animated];
    self.lineview.backgroundColor = [UIColor b lackColor];
    }

  • (void)setSelected:(BOOL)selected animated:(BOOL)animated
    {
    [super setSelected:selected animated:animated];
    self.lineview.backgroundColor = [UIColor blackColor];
    }

相关文章

网友评论

      本文标题:IOS开发-选中某行Cell的时候,添加的分隔线消失的问题

      本文链接:https://www.haomeiwen.com/subject/wankbttx.html