NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离开课还有%@天",[NSString stringWithFormat:@"%@",[[response objectForKey:@"message"] objectForKey:@"days"]]]];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:0/255.0 blue:0/255.0 alpha:1] range:NSMakeRange(6,[[NSString stringWithFormat:@"%@",[[response objectForKey:@"message"] objectForKey:@"days"]] length])];
_dayCount.attributedText = str;
不同颜色文字拼接显示
最新推荐文章于 2022-02-26 15:17:25 发布