iOS富文本属性解释

    xiaoxiao2021-09-02  73

     NSFontAttributeName://(字体)

     NSBackgroundColorAttributeName://(字体背景色)

     NSForegroundColorAttributeName://(字体颜色)

     NSParagraphStyleAttributeName://(段落) 

     NSLigatureAttributeName://(连字符) 

     NSKernAttributeName://(字间距) 

     NSStrikethroughStyleAttributeName://NSUnderlinePatternSolid(实线) | NSUnderlineStyleSingle(删除线) 

     NSUnderlineStyleAttributeName://(下划线)

    NSLinkAttributeName //链接

    //段落属性

    //段落属性 NSMutableParagraphStyle *paragraphStyle = labelDic[NSParagraphStyleAttributeName]; if (!paragraphStyle || nil == paragraphStyle) { paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; paragraphStyle.lineSpacing = 0.0;//增加行高 paragraphStyle.headIndent = 0;//头部缩进,相当于左padding paragraphStyle.tailIndent = 0;//相当于右padding paragraphStyle.lineHeightMultiple = 0;//行间距是多少倍 paragraphStyle.alignment = NSTextAlignmentLeft;//对齐方式 paragraphStyle.firstLineHeadIndent = 0;//首行头缩进 paragraphStyle.paragraphSpacing = 0;//段落后面的间距 paragraphStyle.paragraphSpacingBefore = 0;//段落之前的间距 [atrString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range]; }

    转载请注明原文地址: https://ju.6miu.com/read-677398.html

    最新回复(0)