我想向UITableViewCell
添加“颜色”的逻辑,我的意思是,更改特定的UI属性。但是,只有在第二次单击或表重新加载后才会出现更改。这就是我的尝试:
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
if (selected) {
_titleLabel.textColor = [UIColor colorWithHexString:@"#155aa1"];
_codeLabel.textColor = [UIColor colorWithHexString:@"#155aa1"];
} else {
_titleLabel.textColor = [UIColor blackColor];
_codeLabel.textColor = [UIColor colorWithHexString:@"#b4b5b7"];
}
}