//创建一个带有属性的字符串(比如颜色属性,字体属性)
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] init];
//添加属性
[attrStr addAttribute:NSFontAttributeName value:prefixFont range:[str rangeOfString:prefix]];
[attrStr addAttribute:NSFontAttributeName value:nameFont range:[str rangeOfString:name]];
[attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor lightTextColor] range:[str rangeOfString:prefix]];
label.attributedText = attrStr;