iOS 简单使用富文本格式对一个字符串进行不同设置
来源:互联网 发布:网络约车平台 计划书 编辑:程序博客网 时间:2024/06/06 09:57
NSMutableAttributedString *myText = [[NSMutableAttributedStringalloc] initWithString:[NSStringstringWithFormat:@"%@ %@",titleText,priceText]];
[myText beginEditing];
[myText addAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:16]range:NSMakeRange(0, titleText.length)];
[myText addAttribute:NSForegroundColorAttributeNamevalue:[UIColordarkGrayColor] range:NSMakeRange(0, titleText.length)];
[myText addAttribute:NSFontAttributeNamevalue:[UIFontsystemFontOfSize:30]range:NSMakeRange(titleText.length, myText.length-titleText.length)];
[myText addAttribute:NSForegroundColorAttributeNamevalue:[UIColorredColor] range:NSMakeRange(titleText.length, myText.length-titleText.length)];
[myText endEditing];
moneyLabel.attributedText = myText;
- iOS 简单使用富文本格式对一个字符串进行不同设置
- iOS -字符串替换 富文本的简单使用
- ios 设置富文本
- ios富文本设置
- 链式编程,iOS简单封装属性字符串,实现富文本.
- IOS中的富文本设置
- ios简单富文本demolabel
- UILabel设置富文本格式显示
- iOS 段落富文本使用
- iOS富文本的使用
- iOS-[NSAttributedString]设置富文本和计算富文本高度
- 利用RegularExpression进行富文本设置练习
- 对一个字符串进行简单加密
- iOS富文本字符串AttributedString详解
- iOS富文本字符串AttributedString详解
- iOS NSMutableAttributedString/NSAttributedString 富文本设置
- iOS NSMutableAttributedString/NSAttributedString 富文本设置
- iOS NSMutableAttributedString/NSAttributedString 富文本设置
- Android WebView 因重定向无法正常goBack()解决方案
- poj- 2002-Squares-哈希|除法散列法
- java自学之路--开始就需要摸清楚的环境配置和JDK细节
- Swift版 ScrollView和UITouch事件冲突
- 状压DP问题
- iOS 简单使用富文本格式对一个字符串进行不同设置
- sobel和laplace算子
- Linux____文件的压缩与打包学习笔记
- sublime快捷键
- OC继承的工作机制。
- Eclipse代码整体后退或前移
- 首次涉水Maven+Jersey,入门笔记
- 黑马程序员--java基础--网络编程TCP传输
- Objective-C 数据类型定义的标示符(一)