iOS中改变部分字体颜色
NSString *secondStr = [NSString stringWithFormat:@"认识的单词共计: %ld ",(long)_yesCount];
NSMutableAttributedString *ssa = [[NSMutableAttributedString alloc] initWithString:secondStr];
[ssa addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(8,2)];
_secondLabel.attributedText = ssa;
NSString *thirdStr = [NSString stringWithFormat:@"不认识的单词共计: %ld ",(long)_noCount];
NSMutableAttributedString *ssb = [[NSMutableAttributedString alloc] initWithString:thirdStr];
[ssb addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(9,2)];
_thirdLabel.attributedText = ssb;
转载于:https://www.cnblogs.com/candyMan1001/p/6202504.html
《新程序员》:云原生和全面数字化实践50位技术专家共同创作,文字、视频、音频交互阅读总结
以上是生活随笔为你收集整理的iOS中改变部分字体颜色的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 《C++ Primer Plus(第六版
- 下一篇: Scrapy shell调试网页的信息