NSAttributedString的21种属性详细介绍(图文混排)
iOS_NSAttributedString 的21种属性详细介绍(图文混排)
* API: Character Attributes ,NSAttributedString共有21个属性*
*1.NSFontAttributeName->设置字体属性,默认值:字体:Helvetica(Neue) 字号:12
*2.NSParagraphStyleAttribut
*3.NSForegroundColorAttribu
*4.NSBackgroundColorAttribu
*5.NSLigatureAttributeName->设置连体属性,取值为NSNumber对象(整数),0表示没有连体字符,1表示使用默认的连体字符
*6.NSKernAttributeName->设置字符间距,取值为NSNumber对象(整数),正值间距加宽,负值间距变窄
*8.NSStrikethroughColorAttr
*10.NSUnderlineColorAttribut
*11.NSStrokeWidthAttributeNa
*12.NSStrokeColorAttributeNa
*13.NSShadowAttributeName->设置阴影属性,取值为NSShadow对象
*14.NSTextEffectAttributeNam
*15.NSBaselineOffsetAttribut
*16.NSObliquenessAttributeNa
*17.NSExpansionAttributeName
*18.NSWritingDirectionAttrib
*19.NSVerticalGlyphFormAttri
*20.NSLinkAttributeName->设置链接属性,点击后调用浏览器打开指定URL地址
*21.NSAttachmentAttributeNam
- (void)creatTitleLabel {self.titleLabel = [[UILabelalloc]
initWithFrame:CGRectMake(20,50,320,400)];self.titleLabel.numberOfLines
=0;self.titleLabel.layer.borderColor =
[UIColorgrayColor].CGColor;self.titleLabel.layer.borderWidth
=0.5;self.titleLabel.textAlignment
=NSTextAlignmentLeft;



#pragma mark ** 5. NSLigatureAttributeName 设置连体属性[mAttStri
addAttribute:NSLigatureAttributeNamev
#pragma mark ** 6. NSKernAttributeName 设置字符间距[mAttStri
addAttribute:NSKernAttributeNamevalue












#pragma mark ** 19. NSVerticalGlyphFormAttri
#pragma mark ** 20. NSLinkAttributeName 设置链接属性**
#pragma mark ** 21. NSAttachmentAttributeNam

加载中…