Custom Fonts only available when set in Interface Builder

前端 未结 6 1127
暖寄归人
暖寄归人 2021-01-13 08:50

I have added a custom font to my project. It is included in the target, and it is added in the plist. When I try to use it programmatically it doesn\'t work, and it doesn\'t

6条回答
  •  旧时难觅i
    2021-01-13 09:22

    I know this is old but I just ran into the same issue. The font would show up only if I selected that font in the interface builder. Turns out when I searched for UIAppFonts, it didn't list the main Info.plist (we were already using custom fonts) for some reason. So I ended up adding the fonts to the localized (?) plist file which resulted in this issue. What I had to do was to go to the Project Settings > Target > Info tab and add the font file names there.

提交回复
热议问题