nssting attribute UILabel设置富文本格式显示
NSString *str = [NSStringstringWithFormat:@"¥%@ %@",priceStr,priceDwStr];
NSMutableAttributedString *mutableStr = [[NSMutableAttributedStringalloc]initWithString:str];
// self.priceLab.text=str;
// self.priceLabdw.text=priceDwStr;
NSRange trueNameRange = [str rangeOfString:str];
NSRange positionRange = [str rangeOfString:priceDwStr];
[mutableStr addAttribute:NSForegroundColorAttributeNamevalue:[UIColorblackColor] range:trueNameRange];
[mutableStr addAttribute:NSForegroundColorAttributeNamevalue:[UIColorlightGrayColor] range:positionRange];
[mutableStr addAttribute:NSFontAttributeNamevalue:[UIFontfontWithName:@"HelveticaNeue-Bold"size:16] range:trueNameRange];
[mutableStr addAttribute:NSFontAttributeNamevalue:[UIFontfontWithName:@"HelveticaNeue-Bold"size:13] range:positionRange];
_priceLab.attributedText = mutableStr;