UITextView 修改行間距

weixin_33895657發表於2016-08-31

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

paragraphStyle.lineSpacing = 0;

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

_textview.attributedText = [[NSAttributedString alloc]initWithString:_textview.text attributes:attributes];

相關文章