- (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; //cell 没被选中时 隐藏这个 _leftImageView self.leftImageView.hidden = !selected; //选中text变红 不然变灰色 self.textLabel.textColor = selected ? [UIColor redColor] : [UIColor grayColor]; // Configure the view for the selected state } 下面的截图中 设置后 cell 被选中了 也不会进入高亮状态
时间: 2024-12-01 03:59:47