gpt4 book ai didi

ios - NSUnderlineStyle 属性名称 下划线间距

转载 作者:IT王子 更新时间:2023-10-29 08:15:13 24 4
gpt4 key购买 nike

我希望下划线像任何其他正常的下划线机制一样位于文本下方。但是,对于 NSAttributed 字符串,它会留下带有“g's”和“y's”的漏洞

例子: enter image description here

它应该是怎样的:enter image description here

如何增加下划线和标签之间的间距?

最佳答案

无法使用 NSAttributedString 或 CoreText 来控制该行为(除了自己绘制下划线)。 NSAttributedString对此没有选择(和 CoreText hasn't got one, either )。

在 Apple 系统上,第一个版本(有间隙)是“预期”行为,因为它是 Apple 提供并在整个系统(以及 Safari、TextEdit 等应用程序)中使用的版本。

如果你真的非常想要没有间隙的下划线,你需要绘制没有下划线的字符串并自己画线(我需要做 in one of my projects and I can tell you it's hard ;参见 this file ,搜索“underline” ).

关于ios - NSUnderlineStyle 属性名称 下划线间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27710514/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com