美文网首页
富文本常用属性(NSAttributedString)

富文本常用属性(NSAttributedString)

作者: 米修斯_ | 来源:发表于2016-07-18 14:35 被阅读72次

NSAttributedString   在 foundation  ,UIKit 中都有一个category 

NSFontAttributeName:字体 value :UIFont 

NSParagraphStyleAttributeName : 段落样式   value :NSParagraphStyle 类型 

NSForegroundColorAttributeName: 字体颜色 value:UIColor 

NSBackgroundColorAttributeName: 背景颜色  value:UIColor 

NSLigatureAttributeName:连笔字 value: 0 或  1 

NSKernAttributeName:字间距  value:NSNumber 

NSStrikethroughStyleAttributeName:删除线 value: 1 或0 

NSUnderlineStyleAttributeName:下划线  value:1 或 0 

NSStrokeColorAttributeName:字体描边颜色 value : UIColor 

NSStrokeWidthAttributeName: 字体描边  CGFloat  默认 0 是没有描边

NSShadowAttributeName : 字体阴影 value:NSShadow

NSTextEffectAttributeName:    设置文本特殊效果,目前只有图版印刷效果可用    value值:NSString类型 NSTextEffectLetterpressStyle

NSAttachmentAttributeName: 文本附件  可以用来 显示图片

NSLinkAttributeName : 链接 value  NSURL 或者 NSString (主要用在UITextView 中)

相关文章

网友评论

      本文标题:富文本常用属性(NSAttributedString)

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