简体   繁体   English

如何在Xcode 6中设计时自定义字体?

[英]How to do Custom Fonts at design time in Xcode 6?

It was explained in the WWDC 2014 videos that you can have Custom Fonts at designing time directly in Storyboard, but so far I only see the list of iOS fonts. 在WWDC 2014视频中解释说,您可以直接在Storyboard中设计自定义字体,但到目前为止我只看到iOS字体列表。 Any help? 有帮助吗?

All you have to do is to drag and drop the font files to your Xcode project, then you can find the font in the Custom font list. 您所要做的就是将字体文件拖放到Xcode项目中,然后您可以在自定义字体列表中找到该字体。 You don't even have to have them included in your Application Plist. 您甚至不必将它们包含在您的应用程序Plist中。 That makes things simpler. 这使事情变得更简单。

If you already had fonts added to Xcode 5.1 project, they will not show up in the custom fonts list upon upgrading to Xcode6. 如果您已经将字体添加到Xcode 5.1项目中,则在升级到Xcode6时它们不会显示在自定义字体列表中。 You can just remove references to the fonts then drop them in the project again and check the "copy to target". 您可以删除对字体的引用,然后再将它们放入项目并检查“复制到目标”。 This will show custom fonts in the interface builder custom fonts dropdown on xCode6. 这将在xCode6上的界面构建器自定义字体下拉列表中显示自定义字体。

首先在故事板中使用自定义字体,然后您可以在代码中使用它。

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

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