zoukankan      html  css  js  c++  java
  • 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;

  • 相关阅读:
    053-1
    多项式ADT笔记(数据结构c版)
    052-188
    052-187
    052-186
    052-185
    052-184
    052-183
    052-182
    JS中的垃圾回收(GC)
  • 原文地址:https://www.cnblogs.com/candyMan1001/p/6202504.html
Copyright © 2011-2022 走看看