首页 > 代码库 > iOS开发改变字符串中指定字符颜色,大小等等

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

    NSString *strJTGZ = [NSString stringWithFormat:@"交通管制%d处 ",[jtgz intValue]];        NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc]initWithString:strJTGZ];        [attributedStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(4,  [self getRedNumberLength:[jtgz intValue]])];        [mutableStr appendAttributedString:attributedStr];

 

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