gpt4 book ai didi

ios - 在 iOS 14 中遇到 strokeWidth NSAttributedString 问题

转载 作者:行者123 更新时间:2023-12-03 09:19:51 30 4
gpt4 key购买 nike

我在 iOS 14 上遇到了笔画颜色问题。

let attributes: [NSAttributedString.Key: Any] = [
.foregroundColor: UIColor.white,
.strokeColor: UIColor.black,
.font: UIFont.systemFont(ofSize: 65, weight: .black),
.strokeWidth: -1
]
lableNumber.attributedText = NSAttributedString(string: "2", attributes: attributes)
iOS 13
enter image description here
iOS 14
example
它适用于 iOS 13,但不适用于 iOS 14。谁能帮我解决这个问题?

最佳答案

看起来 Apple 在 iOS 14 中更改了字体轮廓,6 和 9 的字形表现出类似的伪影。我会向Apple提交一个错误。
根据您的要求,使用 UIFont.monospacedSystemFont(...)可以工作,那些字形对我来说看起来还不错。 (编辑:“1”在等宽版本中也有伪像。也许改用 UIFont(name: "HelveticaNeue-Bold", size: 65)?)

关于ios - 在 iOS 14 中遇到 strokeWidth NSAttributedString 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64318125/

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