8

我将如何设置行高或行距NSTextView(即每行有多高,或者每行之间有多少空间)?

4

2 回答 2

22

如果有人需要,请留下答案:

NSMutableParagraphStyle * myStyle = [[NSMutableParagraphStyle alloc] init];
[myStyle setLineSpacing:10.0];
[myTextView setDefaultParagraphStyle:myStyle];
于 2012-04-22T07:26:28.500 回答
14

使用- (void)setDefaultParagraphStyle:(NSParagraphStyle *)paragraphStyleNSTextView 中的方法。

NSParagraphStyle文档

NSMutableParagraphStyle文档

NSMutableParagraphStyle 中有一个setLineSpacing:方法。还有一些与行高相关的方法,NSMutableParagraphStyle 文档中“设置其他样式信息”下的方法应该很有用。

我想这就是你要找的。

于 2009-12-24T20:36:01.677 回答