iOS 如何修改行间距(NSAttributedString 或者 NSMutableAttributedString)

如何用UITabel 展示

// 添加行间距
NSMutableParagraphStyle * paragraph = [[NSMutableParagraphStyle alloc]init];
paragraph.lineSpacing = 2.0;

// 字体: 大小 颜色 行间距
NSAttributedString * attributedStr = [[NSAttributedString alloc]initWithString:instr attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17],NSForegroundColorAttributeName:SystemContentColor,NSParagraphStyleAttributeName:paragraph}];

你可能感兴趣的:(iOS 如何修改行间距(NSAttributedString 或者 NSMutableAttributedString))