ios - 字体样式在 Xcode 11 Beta 中发生更改问题

标签 ios iphone xcode11

  1. Xcode 11 Beta 中创建新项目或打开现有项目。
  2. 使用Plain 文本创建UILabel 并保持系统字体为Regular 样式。

enter image description here

  1. 将文本类型更改为Attributed String 并检查字体样式,似乎它会随着字体样式的不同而变化,而不是保持不变。

enter image description here

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/

相关文章:

javascript - react native : How do I style NavigationExperimental's NavigationCardStack and NavigationHeader?

ios - UITextField Xcode 的圆角

ios - 垂直位置不明确

iPhone 核心图刻度线未显示

iphone - 标记文本解析器,如 Objective-C 中 stackoverflow 的格式化程序

Xcode 11 上的 iOS 13 上的 iOS 布局中断 - 未调用 traitCollectionDidChange

ios - Grand Central Dispatch 无障碍

iphone - CoreGraphics 用不同颜色渲染两条或多条线

ios - 使文本字段多行 - SwiftUI

xcode11 - Xcode 11 调试器非常慢