Custom Fonts only available when set in Interface Builder

前端 未结 6 1151
暖寄归人
暖寄归人 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条回答
  •  清歌不尽
    2021-01-13 09:41

    As mentioned by others, following article is very useful to diagnose the problem. http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

    Also while adding custom fonts to Xcode project, add individual font and not the directory in which all fonts are stored. If you add that directory, fonts will be visible in Interface Builder but not in the running app.

提交回复
热议问题