UITextView 设置行间距

来源:互联网 发布:傲剑洞箫升级数据大全 编辑:程序博客网 时间:2024/06/05 09:07

有时候 textview 需要行间距,一下子还想不起来怎么写,所以我自己把这个记录一下了,给更多的人去查看。

UITextView *_footerCententTxt = [[UITextView alloc] init];NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];paragraphStyle.lineSpacing = 7;     //行间距NSDictionary *attributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:15], NSParagraphStyleAttributeName:paragraphStyle};_footerCententTxt.attributedText = [[NSAttributedString alloc] initWithString:kAboutCentent attributes:attributes];
0 0
原创粉丝点击