不同颜色文字拼接显示
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;
相关文章推荐
- Win7下vc++6.0打开项目Microsoft(R) Developer Studio以及Unable to register this add-in because its DLLRegist
- iOS NSArray API集合
- easyui分页,根据网友的一段代码优化了一下
- Maven学习
- 平安科技移动开发二队技术周报(第六期)
- jQuery时间验证和转换为标准格式的时间
- #ifdef #else #endif #fi #ifndef 的用法
- GRE写作高分速成句式有哪些
- 今天你花出的钱买到物有所值的产品了吗?
- Uva - 10474 - Where is the Marble?
- SQL基础教程
- redis操作实战
- Uva - 10474 - Where is the Marble?
- 正则表达式学习
- 性能测试新手误区(七)
- win7 32位系统下 Cygwin 安装使用说明
- Oracle中添加新用户
- Google LOGO现代舞舞蹈动画
- SQL SERVER 复制相关存储过程
- 第二次团队冲刺5