NSMutableAttributedString 属性字符串的使用
2015-07-29 22:13
323 查看
NSString *priceString = [NSString
stringWithFormat:@"¥%.2f ",model.curprice.doubleValue];
NSMutableAttributedString *attrPriceString = [[NSMutableAttributedString
alloc]
initWithString:priceString
attributes:@{NSForegroundColorAttributeName:RGB(253,
126,
49),NSFontAttributeName:[UIFont
systemFontOfSize:14],NSStrikethroughStyleAttributeName:@(NSUnderlineStyleNone)}];
[attrPriceString addAttributes:@{NSFontAttributeName:[UIFont
systemFontOfSize:10]}
range:NSMakeRange(0,
1)];
self.priceLabel.attributedText = attrPriceString;
stringWithFormat:@"¥%.2f ",model.curprice.doubleValue];
NSMutableAttributedString *attrPriceString = [[NSMutableAttributedString
alloc]
initWithString:priceString
attributes:@{NSForegroundColorAttributeName:RGB(253,
126,
49),NSFontAttributeName:[UIFont
systemFontOfSize:14],NSStrikethroughStyleAttributeName:@(NSUnderlineStyleNone)}];
[attrPriceString addAttributes:@{NSFontAttributeName:[UIFont
systemFontOfSize:10]}
range:NSMakeRange(0,
1)];
self.priceLabel.attributedText = attrPriceString;
相关文章推荐
- 7.5.2 Point-in-Time Recovery Using Event Positions
- C++内存管理
- 解决执行python 脚本一闪而过问题
- 代码整洁之道笔记-有意义的命名
- 解决执行python 脚本一闪而过问题
- 什么是socket ??
- 给数组对象sort函数传递比较函数参数的一点反思
- Spreadsheet Tracking
- 博客开篇
- Intent(有无返回值得跳转)
- 黑马程序员——Java基础---常见对象2
- Sort List
- iOS 注意细节及使用方法
- Sort List
- [Leetcode] Binary Tree Right View Side
- Unix网络编程--卷一:套接字联网API 读书笔记
- 2015.07.29总结
- UIView
- 2015 Multi-University Training Contest 3 1004 painter
- UI的类--UIView