简体   繁体   English

如何在Xcode中更改故事板的背景颜色?

[英]How to change background color of storyboard in Xcode?

I'm working with white text (labels) in Xcode, and currently I can't see them because the background of the storyboard is also white. 我正在使用Xcode中的白色文本(标签),目前我看不到它们,因为故事板的背景也是白色的。 How do I change the appearance of the storyboard? 如何更改故事板的外观?

To clarify, I do not want my text to change color, I only want to change the appearance of the storyboard so that I can develop more easily. 为了澄清,我不希望我的文字改变颜色,我只想改变故事板的外观,以便我可以更容易地发展。

If you are referring to the white in your view controller: 如果您在视图控制器中引用白色:

  • Select the View 选择视图
  • Go to inspector (right panel, 4th item) 去检查员(右图,第4项)
  • Change the background color field (section view) 更改背景颜色字段(剖面视图)

I'm not sure you can do what you're trying to achieve. 我不确定你能做到你想要达到的目标。 My best advice to you would be to create a dark coloured UIView which you can place behind the UILabel . 我最好的建议是创建一个深色的UIView ,你可以放在UILabel后面。 Once you're happy you've got the UILabel setup the way you want it you can then just delete the UIView . 一旦你开心,你就可以按照你想要的方式获得UILabel ,你可以删除UIView

I have a quick trick. 我有一个快速的伎俩。 Set the "shadow" color, on the attributes inspector for the label, to black or whatever your actual background color is. 在标签的属性检查器上将“阴影”颜色设置为黑色或任何实际背景颜色。

属性检查员 它如何出现在故事​​板中的示例

This is the way the text will show up in the storyboard. 这是文本将在故事板中显示的方式。 Hopefully adding the shadow won't be too expensive for your app, and you could take it out later. 希望添加阴影对于您的应用来说不会太昂贵,您可以稍后将其取出。

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

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