通过NSMutableParagraphStyle可以设置行与行之间的间隔,代码如下:
NSMutableAttributedString *string1 = [[NSMutableAttributedString alloc]initWithString:string];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
[paragraphStyle setLineSpacing:4];
[string1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0,string.length)];
CGRect sizestring = [string boundingRectWithSize:CGSizeMake(kScreen_Width - 30,1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:FontSize(14),NSParagraphStyleAttributeName:paragraphStyle} context:nil];