UILabel设置不同的字体颜色
来源:互联网 发布:java怎么驱动图像 编辑:程序博客网 时间:2024/06/11 08:49
NSMutableAttributedString
*str = [[
NSMutableAttributedString
alloc] initWithString:@
"Using NSAttributed String"
];
[str addAttribute:
NSForegroundColorAttributeName
value:[UIColor blueColor] range:
NSMakeRange
(0,5)];
[str addAttribute:
NSForegroundColorAttributeName
value:[UIColor redColor] range:
NSMakeRange
(6,12)];
[str addAttribute:
NSForegroundColorAttributeName
value:[UIColor greenColor] range:
NSMakeRange
(19,6)];
[str addAttribute:
NSFontAttributeName
value:[UIFont fontWithName:@
"Arial-BoldItalicMT"
size:30.0] range:
NSMakeRange
(0, 5)];
[str addAttribute:
NSFontAttributeName
value:[UIFont fontWithName:@
"HelveticaNeue-Bold"
size:30.0] range:
NSMakeRange
(6, 12)];
[str addAttribute:
NSFontAttributeName
value:[UIFont fontWithName:@
"Courier-BoldOblique"
size:30.0] range:
NSMakeRange
(19, 6)];
attrLabel.attributedText = str;
0 0
- UILabel设置不同的字体颜色
- UILabel设置不同的字体颜色
- UILabel设置不同的字体不同的颜色
- 给UIlabel设置不同字体 颜色 下划线
- iOS:UILabel设置不同字体颜色
- UILabel显示不同的颜色和字体
- 同一个UILabel不同的字体颜色
- UILabel,下划线,不同的字体颜色
- UILabel显示不同的字体和颜色
- UILabel显示不同的字体和颜色
- 设置UILabel上面的文字显示不同的字体和颜色
- UILabel设置多种字体、颜色
- UILabel设置多种字体、颜色
- UILabel设置多种字体、颜色
- UILabel设置多种字体、颜色
- UILabel设置多种字体、颜色
- UILabel 设置不同颜色,不同字体
- UILabel 设置不同颜色,不同字体
- IOS的生命周期
- C语言面试题_2015.4.28
- 天声人語 20150501
- 日经春秋 20150501
- source insight中添加.S文件
- UILabel设置不同的字体颜色
- 日经社説 20150501 過去にも言及した米議会演説
- 日经社説 20150501 日米の金融政策は幅広い視野で判断を
- ADB server didn't ACK * failed to start daemon * 解决方法
- 我的第一篇文章
- 社説 20150501 NHK過剰演出 やらせはないと言い切れるか
- PHP如何以post形式发送xml数据
- Start to be an application software developer
- 2014找工作----扎实的基础和开阔的视野是企业最看重的因素