不同颜色文字拼接显示
2015-12-21 09:56
435 查看
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"距离开课还有%@天",[NSString stringWithFormat:@"%@",[[response objectForKey:@"message"] objectForKey:@"days"]]]]; [str addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithRed:255/255.0 green:0/255.0 blue:0/255.0 alpha:1] range:NSMakeRange(6,[[NSString stringWithFormat:@"%@",[[response objectForKey:@"message"] objectForKey:@"days"]] length])]; _dayCount.attributedText = str;
相关文章推荐
- jQuery API
- 如何处理iOS中照片的方向
- 前端优化-Img与background
- 在WPF中区别TextBlock和Label
- 利用Python脚本一键备份Mysql数据库
- 【详解】Python建立Map写Excel表
- liunx 设置服务开机启动chkconfig
- Java-List排序
- 商业英语句型06
- android Camera相关问题及NV12剪裁旋转
- a标签里面的img出现边框
- 为什么学html5?
- Twaver的mono-desiner导出的json文件解析
- 阿里云服务器之mysql
- WEB 服务器调试利器 Tamper Data
- Android移植 framebuffer
- win10 UWP FlipView
- win10 UWP FlipView
- mysql状态查看 QPS/TPS/缓存命中率查看
- 分布式系统概要