美文网首页
label的段间距-ios

label的段间距-ios

作者: 桔子橙子柚子_F | 来源:发表于2019-05-14 11:16 被阅读0次
    NSString *dLabelString = @"1. XXXXXXX \n2. XXXXXXXX\n3. XXXXXXXX";
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:dLabelString];
        NSMutableParagraphStyle   *paragraphStyle   = [[NSMutableParagraphStyle alloc] init];
        //行间距
        [paragraphStyle setLineSpacing:5.0];
        //段落间距
        [paragraphStyle setParagraphSpacing:7];
        [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [dLabelString length])];
       label.attributedText = attributedString;
    

    相关文章

      网友评论

          本文标题:label的段间距-ios

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