必须在Xcode中将自定义字体文件添加到info.plist吗?

hin*_*rbu 3 uifont ios

只是关于在Xcode中添加自定义字体的问题.在我将它作为ttf文件添加到我的项目资源后,我可以在我的故事板中的标签内使用它.但是我还需要将它添加到info.plist文件中吗?

Cha*_* A. 11

是的,您必须将自定义字体添加到Info.plist中.您可以使用UIAppFontInfo.plist键(Fonts provided by application在plist编辑器中显示)来执行此操作.

这是相关文档.

一个例子:

<key>UIAppFonts</key>
<array>
    <string>SomeFont.otf</string>
    <string>SomeOtherFont.otf</string>
</array>
Run Code Online (Sandbox Code Playgroud)