简体   繁体   中英

Xcode Custom Fonts Not Simulating

I've seen that this question has already been asked but none of the previous answers have solved my problem. I have carefully followed multiple tutorials to adding custom fonts to an xcode project so I am sure that I have set it all up right.

The problem is that in the main.storyboard, the 'name' label shows the custom font but when I run the simulator the font doesn't show. The problem can be summed up in this screen shot showing both the storyboard and the simulator (the name label.text is "Luna"). Is this a problem with the simulator?

I followed this tutorial http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/ when I added the font. I downloaded the custom font then installed in from 'FontBook', after that I added the font.TTF into the supporting files folder in my Xcode project and made sure to add the target membership to my app. I included my iOS custom fonts in my application plist. To set the font to the label all I did was set it in the labels attribute inspector.

The language of the project is swift. 字形

自定义字体

Add your fonts to your bundle resources aswell as the project files

According to your screen shoot the font of the label is System 32.0 . Set your font into font field in interface builder or through code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM