美文网首页
UILabel设置行高

UILabel设置行高

作者: Do_More | 来源:发表于2017-08-21 12:48 被阅读0次
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:self.tipsLabel.text];
    
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:4];
    [attributedString addAttribute:NSParagraphStyleAttributeName
                             value:paragraphStyle
                             range:NSMakeRange(0, [self.tipsLabel.text length])];
    
    self.tipsLabel.attributedText = attributedString;
    

    相关文章

      网友评论

          本文标题:UILabel设置行高

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