您的位置:首页 > 产品设计 > UI/UE

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: