iOS- 详解文本属性Attributes

1.NSKernAttributeName: @10 调整字句 kerning 字句调整              

2.NSFontAttributeName : [UIFont systemFontOfSize:_fontSize] 设置字体    

3.NSForegroundColorAttributeName :[UIColor redColor] 设置文字颜色      

4.NSParagraphStyleAttributeName : paragraph 设置段落样式            

5.NSMutableParagraphStyle *paragraph = [[NSMutableParagraphStyle alloc] init];

paragraph.alignment = NSTextAlignmentCenter;

6.NSBackgroundColorAttributeName: [UIColor blackColor] 设置背景颜色        

7.NSStrokeColorAttributeName设置文字描边颜色,需要和NSStrokeWidthAttributeName设置描边宽度,这样就能使文字空心.

NSStrokeWidthAttributeName这个属性所对应的值是一个 NSNumber 对象(小数)。该值改变描边宽度(相对于字体size 的百分比)。默认为 0,即不改变。正数只改变描边宽度。负数同时改变文字的描边和填充宽度。例如,对于常见的空心字,这个值通常为3.0。

同时设置了空心的两个属性,并且NSStrokeWidthAttributeName属性设置为整数,文字前景色就无效果了

效果:

效果:

8. NSStrikethroughStyleAttributeName 添加删除线,strikethrough删除线      

效果:

9. NSUnderlineStyleAttributeName 添加下划线                      

效果:

10. NSShadowAttributeName 设置阴影,单独设置不好使,必须和其他属性搭配才好使。  

和这三个任一个都好使,NSVerticalGlyphFormAttributeName,NSObliquenessAttributeName,NSExpansionAttributeName

11.NSVerticalGlyphFormAttributeName                      

该属性所对应的值是一个 NSNumber 对象(整数)。0 表示横排文本。1 表示竖排文本。在 iOS 中,总是使用横排文本,0 以外的值都未定义。

效果:

12. NSObliquenessAttributeName设置字体倾斜。Skew 斜                

效果:

13. NSExpansionAttributeName 设置文本扁平化                    

效果:

iOS- 详解文本属性Attributes(转)的更多相关文章

  1. iOS- 详解文本属性Attributes

    1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...

  2. 【转】iOS- 详解文本属性Attributes

    原文: http://www.cnblogs.com/qingche/p/3574995.html?utm_source=tuicool 1.NSKernAttributeName: @10 调整字句 ...

  3. 给iOS开发新手送点福利,简述文本属性Attributes的用法

    给iOS开发新手送点福利,简述文本属性Attributes的用法   文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSF ...

  4. IOS开发UI基础文本属性Attributes

    文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFo ...

  5. IOS详解TableView——选项抽屉(天猫商品列表)

    在之前的有篇文章讲述了利用HeaderView来写类似QQ好友列表的表视图. 这里写的天猫抽屉其实也可以用该方法实现,具体到细节每个人也有所不同.这里采用的是点击cell对cell进行运动处理以展开“ ...

  6. CSS中详解hight属性

    目录结构: // contents structure [-] hight属性值类型一览表 height的%的使用 定义 实例 需要注意的 参考文章 hight属性值类型一览表 value descr ...

  7. JAVAEE——spring01:介绍、搭建、概念、配置详解、属性注入和应用到项目

    一.spring介绍 1.三层架构中spring位置 2.spring一站式框架 正是因为spring框架性质是属于容器性质的. 容器中装什么对象就有什么功能.所以可以一站式. 不仅不排斥其他框架,还 ...

  8. CSS中详解height属性

    目录结构: contents structure [+] hight属性值类型一览表 height的%的使用 定义 实例 需要注意的 参考文章 hight属性值类型一览表 value describt ...

  9. oracle创建定时器详解|interval属性

    定时任务首先先创建定时任务中的存储过程 create or replace procedure pro_jggl as                                          ...

随机推荐

  1. 由SequenceFile.Writer(key,value)谈toString()方法

    之前有篇博客(http://www.cnblogs.com/lz3018/p/5243503.html)介绍以SequenceFile作为输入源进行矩阵乘法的过程,首先是将矩阵存储到SequenceF ...

  2. VMware三种网络模式组网(转)

    VMware为我们提供了三种网络工作模式,它们分别是:Bridged(桥接模式).NAT(网络地址转换模式).Host-Only(仅主机模式). 打开VMware虚拟机,我们可以在选项栏的“编辑”下的 ...

  3. Java下String逗号数组和List<String>的互相转换

    说明:很遗憾,组装的时候只能遍历. 方法: public static String listToString(List<String> list){ if(list==null){ re ...

  4. hdu2829 四边形优化dp

    Lawrence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total S ...

  5. menuStrip鼠标经过自动显示菜单

    //--------------------------------------------------------------------------------- private void For ...

  6. notepad++ 常用的插件及教程

    NotePad++ 教程 HEX-Editor      http://files.cnblogs.com/pengdonglin137/HexEditor_0_9_5_UNI_dll.zip 我的N ...

  7. 【java】处理时间字段 在数据库查询的时候只想要年月日,不想要时分秒 ,java中设置时间类型为年月日,java中设置Date中的时分秒为00.00.000

    JDK8 中最简单的处理方式: @Test public void dateTest(){ Date now = new Date(); System.out.println(now); // jav ...

  8. php实现简单视图模板(视图引擎)

    视图 视图,你所看见的部分. <?php echo 'hello, world'; 从简单开始理解 这就是个视图文件中的代码,没错就这么简单.视图,实际上是在 MVC 这种架构上提出的.MVC ...

  9. 多个客户端连接socket

    import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import ...

  10. arm-linux-gdb+gdbserver环境搭建以及远程调试

    0) gdb源码下载:http://ftp.gnu.org/gnu/gdb/ 1) 编译arm-linux-gdb 指定交叉编译工具链的位置 export PATH=$PATH:/usr/local/ ...