iOS设置textView的行间距

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

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

    NSDictionary *attributes = @{ 

                                 NSFontAttributeName:[UIFont systemFontOfSize:15], 

                                 NSParagraphStyleAttributeName:paragraphStyle 

                                 }; 

    textView.attributedText = [[NSAttributedString alloc] initWithString:@”输入你的内容” attributes:attributes];

分享到: 更多
Separator image Posted in IOS.