UILabel改变字体行间距



-(void)setLabLineSpacing:(UILabel *)aLab line:(float)fl{
    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:aLab.text];
    NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:20];
    
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [aLab.text length])];
    [aLab setAttributedText:attributedString];
    
}

你可能感兴趣的:(ios,ios开发,CoreText,字体样式,字体行间距)