iOS开发改变字符串中指定字符颜色,大小等等

    NSString *strJTGZ = [NSString stringWithFormat:@"交通管制%d处 ",[jtgz intValue]];
    NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc]initWithString:strJTGZ];
    [attributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(4,jtgz.lenght)];
    [mutableStr appendAttributedString:attributedStr];
原文地址:https://www.cnblogs.com/WJJ-Dream/p/5809182.html