- 在
Xcode 11 Beta
中创建新项目或打开现有项目。 - 使用
Plain
文本创建UILabel
并保持系统字体为Regular 样式。
- 将文本类型更改为
Attributed
String 并检查字体样式,似乎它会随着字体样式的不同而变化,而不是保持不变。
PS:在 Xcode 10
中工作正常。
最佳答案
As per Apple's official document https://developer.apple.com/fonts/
SF Pro:
This sans-serif typeface is the system font for iOS, macOS, and tvOS, and includes a rounded variant. It provides a consistent, legible, and friendly typographic voice.
SF Compact:
This sans-serif typeface is the system font for watchOS, and includes a rounded variant. It suits a wide range of content and is easily legible in a variety of contexts.
因此我们需要下载并安装SF Pro字体,并使用SF Pro Text Regular 18.0
设置UILabel
属性字符串字体样式,以保持与纯文本具有相同的字体样式。
希望对您有所帮助!
干杯!
关于ios - 字体样式在 Xcode 11 Beta 中发生更改问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56470421/