您的位置:首页 > 其它

不同颜色文字拼接显示

2015-06-11 17:11 375 查看
NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@[套餐]",[NSString stringWithFormat:@"%@",[[response objectForKey:@"message"] objectForKey:@"name"]]]];

NSRange ran = {[[NSString stringWithFormat:@"%@",[[response objectForKey:@"message"] objectForKey:@"name"]] length],4};
[AttributedStr setAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:36/255.f green:183/255.f blue:232/255.f alpha:1]} range:ran];
self.orderName.attributedText = AttributedStr;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: