iOS设置UILabel的不同颜色字体
2017-06-30 15:04
281 查看
// 设置不同的字体
let str:NSMutableAttributedString =
NSMutableAttributedString.init(string: priceStr)
str.addAttribute(NSForegroundColorAttributeName, value:
RGBCOLOR(r: 102,
102, 102,
1), range: NSRange.init(location:
0, length: 5))
str.addAttribute(NSFontAttributeName, value:
UIFont.init(name:
"HelveticaNeue-Bold", size:
14)!, range: NSRange.init(location:
0, length: 5))
cell.productCellPriceLab.attributedText = str
let str:NSMutableAttributedString =
NSMutableAttributedString.init(string: priceStr)
str.addAttribute(NSForegroundColorAttributeName, value:
RGBCOLOR(r: 102,
102, 102,
1), range: NSRange.init(location:
0, length: 5))
str.addAttribute(NSFontAttributeName, value:
UIFont.init(name:
"HelveticaNeue-Bold", size:
14)!, range: NSRange.init(location:
0, length: 5))
cell.productCellPriceLab.attributedText = str
相关文章推荐
- iOS:UILabel设置不同字体颜色
- ios设置UILabel中文字的不同颜色和字体字号
- iOS开发笔记--UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色(转)
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- iOS中在UILabel显示不同的字体和颜色,增加下划线
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色(转)
- iOS 在UILabel显示不同的字体和颜色
- iphone ios 如何在同一行中显示不同字体,颜色文本(UILabel)
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色(转)
- [转] iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色
- iOS 在UILabel显示不同的字体和颜色