在NSTextView中设置行高/行间距 [英] Setting the Line Height/ Line Spacing in an NSTextView

查看:631
本文介绍了在NSTextView中设置行高/行间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 NSTextView 中设置行高或行间距(即每行有多高,或每行之间有多少空格)?

How would I set the Line Height or Line Spacing in an NSTextView (i.e. how tall each line is, or how much space is between each line)?

推荐答案

使用 - (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyle 您的NSTextView。

Use the - (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyle method in your NSTextView.

NSParagraphStyle

NSMutableParagraphStyle

在NSMutableParagraphStyle中有一个 setLineSpacing:方法。还有与行高有关的方法,NSMutableParagraphStyle文档中设置其他样式信息下的方法应该证明是有用的。

There is a setLineSpacing: method in NSMutableParagraphStyle. There are also methods relating to line height, the methods under "Setting Other Style Information" in the NSMutableParagraphStyle documentation should prove useful.

我认为这是你正在寻找。

I think that's what you're looking for.

这篇关于在NSTextView中设置行高/行间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆