如何解决在iOS 14中获取strokeWidth NSAttributedString的问题
我在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
iOS 14
它可以在iOS 13上运行,但不能在iOS 14上运行。有人可以帮助我解决此问题吗?
解决方法
好像Apple已经更改了iOS 14中的字体轮廓,6和9的字形显示出相似的伪像。我会向Apple提交错误。
根据您的要求,使用UIFont.monospacedSystemFont(...)
可能有效,这些字形在我看来仍然可以。 (编辑:“ 1”在等距版本中也有伪像。也许使用UIFont(name: "HelveticaNeue-Bold",size: 65)
代替?)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。