UILabel 行间距

 NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStylealloc] init];

    paragraphStyle.lineSpacing = 5.0f;

    

    UIFont *tempFont = [SJBFontpreferedFont:kPreferedFontTypebasicFont:kDefaultFontTypesize:14.0f];

    NSDictionary *tempDict = @{NSFontAttributeName:tempFont, NSKernAttributeName:[NSNumbernumberWithFloat:1.0f],NSParagraphStyleAttributeName:paragraphStyle};

    

 

    _contentLabel.attributedText = [[NSAttributedString alloc]initWithString:tempString attributes:tempDict];

 

 

 

 

NSString *tempS = [NSStringstringWithFormat:@"%@",[data objectForKey:@"summary"]];

        NSMutableAttributedString *attributedString = [[NSMutableAttributedStringalloc] initWithString:tempS];

        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStylealloc] init];

        [paragraphStyle setLineSpacing:3.0f];//调整行间距

        [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [tempS length])];

 

        _englishNameL.attributedText = attributedString;

你可能感兴趣的:(UILabel,UILabel,label,UILabel行间距,行间距)