美文网首页
iOS之文本属性Attributes的使用

iOS之文本属性Attributes的使用

作者: 乡下秋草 | 来源:发表于2017-04-28 14:13 被阅读62次

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设置描边宽度,这样就能使文字空心.

相关文章

网友评论

      本文标题:iOS之文本属性Attributes的使用

      本文链接:https://www.haomeiwen.com/subject/lvoozttx.html