- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
if (selected) {
companyLabel.textColor = [UIColor whiteColor];
priceLabel.textColor = [UIColor whiteColor];
changeLabel.textColor = [UIColor whiteColor];
symbolLabel.textColor = [UIColor whiteColor];
}
else
{
companyLabel.textColor = [UIColor blackColor];
priceLabel.textColor = [UIColor blackColor];
symbolLabel.textColor = [UIColor blackColor];
if([changeLabel.text doubleValue] < 0)
{
changeLabel.textColor = [UIColor colorWithRed:239.0/255.0 green:16.0/255.0 blue:52.0/255.0 alpha:1.0];
}
else if([changeLabel.text doubleValue] > 0)
{
changeLabel.textColor = [UIColor colorWithRed:77.0/255.0 green:161.0/255.0 blue:0.0 alpha:1.0];
}
}
}
我的文本直到下一个视图正在被推入导航栏堆栈之后才变白。
我希望即使用户轻按一个单元格,它也能变白。