简体   繁体   English

无法在Xcode 6 IB中设置自定义字体

[英]Can't set custom font in Xcode 6 IB

I have added a custom font to my project, and it's registered everywhere properly (when I run the application I can see that the font is applied). 我已经在项目中添加了自定义字体,并且该字体已在所有地方正确注册(运行应用程序时,我可以看到已应用该字体)。 However, when I select a UILabel in IB and try to set its font to this custom font, it does not work. 但是,当我在IB中选择UILabel并尝试将其字体设置为该自定义字体时,它不起作用。 The font shows up in the available fonts list however if I select it and apply the dialogue, the font property of the UILabel is unchanged. 字体显示在可用字体列表中,但是如果我选择它并应用对话框,则UILabel的font属性不变。

尝试使用一些代码来解决问题。

 [testable setFont:[UIFont fontWithName:@"MyFont-Italic" size:18.0]];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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