IOS中的自定义字体未反映在设备上 [英] Custom Font in IOS Not Reflected On Device
问题描述
我遵循这个教程,自定义字体显示在我的故事板上,但当我执行我的应用程序(在模拟器或设备上)字体不被反映。任何人都可以帮忙
这就是我所做的:
pre $ 1-下载一个.ttf文件并将其复制到我的项目
在info.plist中添加了由应用程序提供的字体,并添加了一个具有我自定义字体名称的行。
3-打开故事板,选择我想要自定义字体的UILabel,然后选择自定义字体,然后选择我的字体。字体正确显示在故事板上。
我错过了什么吗?
谢谢@Andrey Chernuka和@jcaron。我解决了这个问题,将目标成员设置为我的项目,然后退出项目(由于某种原因,清理工作不起作用)并重新打开项目,一切都已经设好。当我打印 print(UIFont.familyNames())
时,字体名称出现
i followed this tutorial and the custom font was shown on my storyboard but when i executed my app (on simulator or device) the font is not reflected. can anyone help. this is what i did:
1- downloaded a .ttf file and copied it to my project
2- added "Fonts Provided By Application" in info.plist and added a row having the name of my custom font.
3- opened storyboard and selected the UILabel i want to have a custom font for, and selected the font as custom then selected my font. the font was shown on the storyboard correctly.
am i missing something?
Thank you @Andrey Chernuka and @jcaron. I solved the problem by setting the target membership to my project and then exiting the project (cleaning did not work for some reason) and reopening the project and everything was set. the font name was appearing when i printed print (UIFont.familyNames())
这篇关于IOS中的自定义字体未反映在设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!