Attributes的NSDctionary设置
来源:互联网 发布:jquery监听数组长度 编辑:程序博客网 时间:2024/06/05 04:37
attributes最常用的设置就是设置颜色和字体大小,其他效果不是很常用但是也总结一下
NSDictionary *attributesDictionary = [NSDictionarydictionary];
[attributesDictionary setValue:[UIFontsystemFontOfSize:18.0]forKey:NSFontAttributeName];//设置字体大小
[attributesDictionary setValue:[UIColorpurpleColor]forKey:NSForegroundColorAttributeName];//设置文字颜色
[attributesDictionary setValue:[UIColorwhiteColor]forKey:NSBackgroundColorAttributeName];//设置背景色
[attributesDictionary setValue:@5forKey:NSKernAttributeName];//调整间距
[attributesDictionary setValue:@(NSUnderlineStyleSingle) forKey:NSUnderlineStyleAttributeName];//设置下划线(NSUnderlineStyleSingle :单行下划线 NSUnderlineStyleDouble:两行下划线 )
[attributesDictionary setValue:@(NSUnderlineStyleSingle)forKey:NSStrikethroughStyleAttributeName];//添加删除线(value值和下划线用法相同)
[attributesDictionary setValue:@0forKey:NSVerticalGlyphFormAttributeName];//设置横排还是竖排显示,0代表横排显示
[attributesDictionary setValue:@0.5forKey:NSObliquenessAttributeName];//设置字体倾斜度
[attributesDictionary setValue:@1forKey:NSExpansionAttributeName];//设置扁平化
//设置阴影:NSShadowAttributeName
//设置段落样式:NSParagraphStyleAttributeName(数值:nit];
// paragraph.alignment = NSTextAlignmentCenter;)
- Attributes的NSDctionary设置
- Objective-C创建目录接口createDirectoryAtPath:withIntermediateDirectories:attributes:error:中参数attributes的设置
- Objective-C创建目录接口createDirectoryAtPath:withIntermediateDirectories:attributes:error:中参数attributes的设置
- @property (attributes) 迷惑的attributes
- NUnit的常用Attributes
- label的attributes相关
- Attributes的使用
- 我的特性Attributes
- Attributes
- Attributes
- $$Attributes
- iOS- 详解文本属性Attributes(文本的样式设置/阴影/下划线/颜色)
- js 中设置或获取自定义属性的方法setAttribute getAttribute attributes
- Super product attributes configuration 可配置商品如何设置子商品的库存
- jquery的tree的attributes
- Python 的 class attributes 和 instance attributes 的区别
- button控件的.Attributes属性
- 关于Attributes属性的介绍
- Java线程池的实现原理
- 设置tomcat
- tomcat利用setenv对内存的限制和docker中tomcat内存的优雅配置
- MPchart的简单使用及分析
- 如何使用C#Windows窗体完成文件浏览功能:
- Attributes的NSDctionary设置
- 代码与饮食
- 国内各大互联网公司相关技术博客3.0版 (集合腾讯、阿里、百度、搜狐、新浪、网易、360等共29个)
- untiy实现图片的上传和下载
- SSRF
- 单元测试利器-Mockito 中文文档
- @Autowired与@Resource的区别
- mysql修改、删除数据记录
- Redis 快速入门