0

我正在设置段落样式,如下所示:

NSTextStorage *textStorage = self.textView.textStorage;
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
paragraphStyle.paragraphSpacing = FBTweakValue(@"Authoring View", @"Paragraph Style", @"Paragraph Spacing", 40.f);

[textStorage setAttributes:@{NSParagraphStyleAttributeName : paragraphStyle} range:[textStorage fullRange]];

屏风

编辑:我在下面找到了部分答案——它可以很好地修复单行插入符号。但是,当您将选择范围拖出多个单词时,您会得到:

在此处输入图像描述

回到原点!那么如何指定插入符号的高度呢?

注意:我的问题之前曾在 StackOverflow 上发布过一次,但被毫不客气地删除了。如果你要这样做,请至少给我一个理由。谢谢。

4

1 回答 1

0

好的,我在稍微不同的措辞下找到了答案——查看 iOS - UITextView lineSpacing make cursor height not same

编辑:我发现可能的重复问题+解决方案只是部分解决方案,因为如果您选择一系列字符,它不会修复插入符号。

于 2014-08-10T17:29:15.950 回答