问题描述
如何在 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.
在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中设置行高/行间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!