iphone - 无法在 iPhone 应用程序中使用自定义字体

标签 iphone ios xcode fonts truetype

我的 iPhone 应用程序中有 3 个 .ttf 文件。它们代表这 3 种字体:

  • Gotham Rounded Book
  • Gotham Rounded Medium
  • Gotham 圆角粗体

我将它们全部放在我的 .plist 中,但是当我这样做时只有 2 个出现:

NSLog(@"%@",[UIFont fontNamesForFamilyName:@"Gotham Rounded"]);

这是记录的内容:

"GothamRoundedMedium-Regular",
"GothamRoundedBook-Regular"

这里出了什么问题?屏幕截图如下。

enter image description here

enter image description here

最佳答案

这可能是因为您没有像图片那样在目标中包含 gothamroundedbold.ttf。 选择辅助导航器 检查丢失的字体文件的成员资格。在我的情况下它被选中,在你的情况下它应该被取消选中。
enter image description here `

关于iphone - 无法在 iPhone 应用程序中使用自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10743093/

相关文章:

iphone - 子类 MKAnnotationView

ios - UIAlertView 使应用程序崩溃

xcode - App Store 提交了两个成对工作的相关应用程序

ios - 如何获得 Sprite 相对于世界坐标的 zRotation?

iphone - Xcode 'Build and Archive' 菜单项已禁用

iphone - 如何绘制矩形?

ios - IBM MobileFirst 8.0 : JSONStore initialization issue on iOS 13. 1

ios - (iOS) 在数组中添加来自 json 的数据

ios - 它不会构建失败,它会显示 "No Issues"但仍然无法正常工作

iphone - 登录和注册错误 3840