Xcode 9自定义字体不起作用 [英] Xcode 9 custom fonts not working

查看:111
本文介绍了Xcode 9自定义字体不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自定义字体在Xcode 9中不起作用。但是,如果我在Xcode 8中打开相同的项目,自定义字体按预期工作

Custom fonts not working in Xcode 9. However if I open the same project in Xcode 8, the custom fonts work as expected

我已经运行了这块确保字体显示的代码:

I've ran this piece of code to ensure the fonts show up:

NSArray *fontFamilies = [UIFont familyNames];

for (int i = 0; i < [fontFamilies count]; i++)
{
    NSString *fontFamily = [fontFamilies objectAtIndex:i];
    NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]];
    NSLog (@"%@: %@", fontFamily, fontNames);
}

我确保字体是plist,已检查的目标成员资格,以及在副本包资源部分。

I've ensured the fonts are in the plist, checked target membership, and in the copy bundle resource section.

这是一个Xcode错误吗?

Is this an Xcode bug?

推荐答案

我有这个问题,

确保点击你的字体文件夹以确保它们包含在你的目标会员资格中。

make sure that you Click on your font folder to make sure they are included in your "Target Membership."

这篇关于Xcode 9自定义字体不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆