问题描述
我在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)
代替?)