iOS UILabel UITextView UIButton 等等显示文本行间距

iOS UILabel  UITextView UIButton 等等显示文本行间距都用如下方法

NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];

paragraphStyle.lineSpacing = 5;// 字体的行间距

NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:15],NSParagraphStyleAttributeName:paragraphStyle};

label.attributedText = [[NSAttributedString alloc] initWithString:self.showDetailView.text attributes:attributes];

上一篇:Python循环嵌套


下一篇:CSS引用样式