设置ulabel的行间距

NSString *text = @"我是一个好人,12份绿色购物个 i 认为个人我国 i 加热哦围观 i我国3噢奇怪级我过街天桥哦推荐我她否认";
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStyle setLineSpacing:8];

UIColor *color = [UIColor blackColor];
NSAttributedString *string = [[NSAttributedString alloc] initWithString:text attributes:@{NSForegroundColorAttributeName : color, NSParagraphStyleAttributeName: paragraphStyle}];


UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
[self.view addSubview:label];
label.attributedText = string;

  label.isAttributedContent = YES;

原文地址:https://www.cnblogs.com/hualuoshuijia/p/5305371.html