简体   繁体   English

无法在XCode 6.1.1中更改字体

[英]Can't change font in XCode 6.1.1

Within XCode 6.1.1 I'm unable to change the font on my label within my storyboard. 在XCode 6.1.1中,我无法在情节提要中更改标签上的字体。 I can set 'Text' to either 'Plain' or 'Attributed', but then [T] next to Helevetica Neue 17.0 appears grayed out, and it does not do anything when I click it. 我可以将“文本”设置为“普通”或“属性”,但是Helevetica Neue 17.0旁边的[T]会显示为灰色,并且单击该按钮时不会执行任何操作。 This happens in all of my projects. 这发生在我所有的项目中。

Screenshot here: https://i.imgur.com/3VOSsVn.png 此处的屏幕截图: https//i.imgur.com/3VOSsVn.png

Thank you! 谢谢!

Edit: Unfortunately none of the answers below have answered my question yet. 编辑:不幸的是,下面的答案都没有回答我的问题。 The [T] is unclickable.. it is grayed out so I can't change the Font to custom under there. [T]是不可单击的..它显示为灰色,因此我无法在此处将字体更改为custom。 And while I could go in and enter code to change the font, I would prefer to do it through the GUI. 虽然我可以输入更改字体的代码,但我希望通过GUI进行操作。

This problem was driving me crazy - your workaround works for the normal storyboard, but not for the Watch storyboard which has a custom fonts popup. 这个问题使我发疯-您的解决方法适用于普通的故事板,但不适用于具有自定义字体弹出窗口的Watch故事板。

I finally found this page: https://github.com/synergy/synergy/issues/4109 我终于找到了这个页面: https : //github.com/synergy/synergy/issues/4109

It's a bug with using Synergy - I connected a USB mouse to my Mac and when I click the font "T" icon with the USB mouse, it works!!!! 使用Synergy是一个错误-我将USB鼠标连接到了Mac,当我用USB鼠标单击字体“ T”图标时,它可以工作!

Actually, you have to first select a syntax category in the detail area. 实际上,您必须首先在详细信息区域中选择一种语法类别。 You can press CMD+A to select all categories. 您可以按CMD + A选择所有类别。 Then you can click the "T" and select a new font. 然后,您可以单击“ T”并选择一种新字体。

See here: https://developer.apple.com/library/ios/recipes/xcode_help-fonts_and_colors_preferences_help/Recipe.html 参见此处: https : //developer.apple.com/library/ios/recipes/xcode_help-fonts_and_colors_preferences_help/Recipe.html

在“字体”中,将“系统”更改为“自定义”

You can set font for labels in two ways- programmatically and in storyboard. 您可以通过两种方式设置标签的字体-编程方式和情节提要。

In your storyboard, you need to click the little T and then select the wanted font. 在情节提要中,您需要单击小T,然后选择所需的字体。

In your code, assuming you already set the appropriate IBOutlets, you can use something like 在您的代码中,假设您已经设置了适当的IBOutlets,则可以使用类似

[self.theTextLabel setFont:[UIFont boldSystemFontOfSize:17.0]];

点击已分配的字体旁边的“ T”符号,然后将“系统”更改为“自定义”。一旦自定义设置,就可以更改字体及其粗细(例如,浅色,粗体...)

我确实找到了解决方法...我可以通过crtl-shift-opt-T调出字体菜单,然后在此处更改字体,我所做的更改会反映在页面上...但是[T]仍然显示为灰色由于某些原因。

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

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