// 字体的属性列表 颜色 字体大小NSFontAttributeName
NSDictionary *dictstr = @{
NSForegroundColorAttributeName : [UIColor whiteColor],
NSBackgroundColorAttributeName : [UIColor redColor]
};
// 新建带样式的文字
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:_rightLabel.text attributes:dictstr];
// 查找:的范围
NSRange range1 = [[attrStr string] rangeOfString:@":"];
NSRange range2 = [[attrStr string] rangeOfString:@"0" options:NSBackwardsSearch];
// 设置:的文字和背景颜色
[attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor] range:range1];
[attrStr addAttribute:NSBackgroundColorAttributeName value:[UIColor clearColor] range:range1];
[attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor] range:range2];
[attrStr addAttribute:NSBackgroundColorAttributeName value:[UIColor clearColor] range:range2];
[_rightLabel setAttributedText:attrStr];