设置label行间距

  [_contentLabelsetAttributedText:[selfsetContent:content]];


- (NSMutableAttributedString *)setContent:(NSString *)content

{


    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:content];


    NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];

    [paragraphStylesetLineSpacing:2.5];//设置行间距

    [attributedStringaddAttribute:NSParagraphStyleAttributeNamevalue:paragraphStylerange:NSMakeRange(0, [contentlength])];

    returnattributedString;

}

你可能感兴趣的:(设置label行间距)