当我';您在iOS中指定了较大的段落间距吗?

当我';您在iOS中指定了较大的段落间距吗?,ios,uikit,uitextview,caret,nsparagraphstyle,Ios,Uikit,Uitextview,Caret,Nsparagraphstyle,我这样设置段落样式: NSTextStorage *textStorage = self.textView.textStorage; NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; paragraphStyle.paragraphSpacing = FBTweakValue(@"Authoring View", @"Paragraph Style",

我这样设置段落样式:

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]];

编辑:我在下面找到了一个部分答案-它修复了单行插入符号。但是,当您拖出多个单词的选择范围时,会得到以下结果:

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

NB:我的问题被贴出来了,但被随意删除了。如果你要这么做,请至少给我一个理由。非常感谢。

好的,我找到了一个措辞稍有不同的答案-请查看


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

实际上,即使这样也不能完全解决问题。使用范围选择时(在某些单词上拖动选择),选择的两个“极点”仍然很长!然后在你回答这个问题时说。然后ping我,这样我就可以收回我的投票:)Heya@SantaClaus我已经做了你可能想要的编辑。