ios 如何在 Xcode 中更改故事板的背景颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10602253/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change background color of storyboard in Xcode?
提问by Nosrettap
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. How do I change the appearance of the storyboard?
我正在 Xcode 中处理白色文本(标签),目前我看不到它们,因为故事板的背景也是白色的。如何更改故事板的外观?
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.
澄清一下,我不希望我的文本改变颜色,我只想改变故事板的外观,以便我可以更轻松地开发。
回答by Damien Locque
If you are referring to the white in your view controller:
如果您指的是视图控制器中的白色:
- Select the View
- Go to inspector (right panel, 4th item)
- Change the background color field (section view)
- 选择视图
- 转到检查员(右侧面板,第 4 项)
- 更改背景颜色字段(剖面视图)
回答by The Crazy Chimp
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
. Once you're happy you've got the UILabel
setup the way you want it you can then just delete the UIView
.
我不确定你能做你想要实现的目标。我对你最好的建议是创建一个深色的UIView
,你可以把它放在UILabel
. 一旦您感到满意,您就UILabel
可以按照您想要的方式进行设置,然后只需删除UIView
.
回答by davidrynn
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.
这是文本在故事板中的显示方式。希望为您的应用添加阴影不会太昂贵,您可以稍后将其删除。