设置字体的行距和大小颜色等
2016-01-26 14:15
363 查看
http://blog.csdn.net/sinat_19587549/article/details/41683199?utm_source=tuicool&utm_medium=referral这篇博文写的很好,字体的颜色,大小,字体样式,行间距等都涉及到。值得推存的一篇文章。
// 在该方法中设置 - (void)setTextString:(UILabel *)label { NSString *string = @"字体大小颜色"; //设置字间距 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.lineSpacing = 3.5; //行距 NSDictionary *attributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:15], NSParagraphStyleAttributeName:paragraphStyle}; label.attributedText = [[NSAttributedString alloc]initWithString: string attributes:attributes]; }
相关文章推荐
- Cygwin安装curl后 bash: curl: command not found
- Windows 无法连接到无线网络
- python读取剪切板内容
- Android自定义底部显示对话框
- 关于 回调 、 反射 和异步的一些理解---初级知识
- window批处理-3.go
- 虚方法(virtual)和抽象方法(abstract)的区别
- php 会话控制 文件上传
- Oracle数据库迁移--->从Windows到Linux
- CI框架 -- 核心文件 之 Exceptions.php
- JMeter监控服务器CPU, 内存,网络数据
- JAVA单链表基本操作
- Proxy-Style Redis集群设计
- 【Boost】boost库中thread多线程详解2——mutex与lock
- 知识片段---键盘光标设置
- Maven -- 第一次使用Maven
- java中逻辑右移">>>"算术右移">>"的区别?
- QT5使用消息机制及程序发布相关
- 谈谈Javascript中的异步调用的上下文
- 一些科学研究中的认识