iOS UILabel一行字设置不同的字体
2015-09-29 16:50
585 查看
NSString *babyName = @"测试";
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"111111111%@222",babyName]]; [str addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:NSMakeRange(9, babyName.length)]; self.lbTips.attributedText = str ;
这样 就可以设置一个label的不同区间的不同字体了
那 str 可以添加多个属性
相关文章推荐
- NavigationBar和UINavigationController一样是一个容器
- ios上 更改 状态栏(UIStatusBar)的颜色,你值得一看、收藏
- master and slave have equal MySQL server UUIDs 解决方法
- UITableView之LOL英雄展示
- 如何隐藏RibbonBar的QAT QuickAccessToolBar
- 使用 xcodebuild 从 archive 导出 ipa
- EasyUI - Tabs
- 将标准输入复制到标准输出
- ios开发之UIImageView
- easyUI-->datagrid事件问题
- 定制自己的SolrRequestHandler
- LeetCode题解——Implement Queue using Stacks
- Archive for required library: ‘WebContent/WEB-INF/lib/xxx.jar cannot&n
- LeetCode题解——Implement Stack using Queues
- 百度编辑器UEditor使用方法
- mysql 查询缓存 query_cache_type
- query cache 的内存使用和调优
- 25+ Useful Selenium Web driver Code Snippets For GUI Testing Automation
- NGUI动画/UI解决刷新显示错误的问题
- UIPickView 的高度 iOS9 Xcode7