设置行高/行距在NSTextView行距、NSTextView

2023-09-12 21:26:51 作者:网络绑架了、我的孤单

我怎么会在设置行高或行距的 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)?

推荐答案

使用了 - (无效)setDefaultParagraphStyle:在你的NSTextView(NSParagraphStyle *)paragraphStyle 方法

在NSParagraphStyle

在NSMutableParagraphStyle

有一个 setLineSpacing:在NSMutableParagraphStyle 方法。也有与行高的方法,该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. =]