简体   繁体   English

使用UILabel的属性字符串设置在Interface Builder中显示自定义字体

[英]Show custom fonts in Interface Builder with UILabel's attributed string setting

When I use the UILabel's attributed setting in Xcode 5's Interface Builder, it will show a preview on the storyboard for built-in fonts like American Typewriter. 当我在Xcode 5的Interface Builder中使用UILabel的属性设置时,它将在情节提要上显示内置字体(如American Typewriter)的预览。 When I try to use it with a custom font, it only shows it in the preview area, not on the storyboard. 当我尝试将其与自定义字体一起使用时,它仅在预览区域而不是在情节提要板上显示。

Is it possible to show the preview in the storyboard with custom fonts? 是否可以使用自定义字体在情节提要中显示预览?

Here are some screen shot examples: 以下是一些屏幕截图示例:

You can see that 'FOOBAR' shows the custom font in the inspector 您可以看到“ FOOBAR”在检查器中显示了自定义字体

检查员

But not on the storyboard 但不在情节提要上

故事板

In Xcode 6 you need to select, highlight, the preview text in interface builder. 在Xcode 6中,您需要在界面生成器中选择,突出显示预览文本。 Then change the fonts. 然后更改字体。 You then will see it. 然后您将看到它。

在此处输入图片说明

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

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