一行字显示多种颜色
methodlab.textColor = [UIColor blackColor];
methodlab.attributedText =[self changeLabstrColor:5 withstr:[NSString stringWithFormat:@"使用方法:%@",_order.ctext]] ;
//改变lab中字体颜色 显示多种颜色
-(NSAttributedString*)changeLabstrColor:(int)range withstr:(NSString*)str {
NSMutableAttributedString *str3 = [[NSMutableAttributedString alloc]initWithString:str];
//设置:在0-5个单位长度内的内容显示成灰色
[str3 addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor] range:NSMakeRange(0, range)];
return str3;
}