1. 改变指定字符的颜色
NSString * text = [NSString stringWithFormat:@"%@米",distance];
NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc]initWithString:text];
[attributedStr addAttribute:NSForegroundColorAttributeName value:blackTextColor range:NSMakeRange(text.length -1,1)];
cell.labelright.attributedText = attributedStr;
2.在价格中间加横线
NSString * text = [NSString stringWithFormat:@"¥ %@",[sourseDic objectForKey:@"originalPrice"]];
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString: text];
[attrStr addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, text.length)];
cell.labelOldPrice.attributedText = attrStr;