首页 > 代码库 > UILabel改变字体行间距

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];    }

UILabel改变字体行间距