XCode Interface Builder 背景色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19206940/
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
XCode Interface Builder Background color
提问by malcoauri
I'm a newby in XCode/iOS development, and I want to change bakckground color of my label (XCode 5.0):
我是 XCode/iOS 开发的新手,我想更改标签的背景颜色(XCode 5.0):
- Opened my storyboard
- Chose my label on the left side
- Opened attributes inspector on the right side
- 打开我的故事板
- 在左侧选择我的标签
- 在右侧打开属性检查器
But this tab has got settings of font, alignment, but no background color options! There is "View" section at the bottom, but it is empty. Please, tell me where can I find settings of background color? Thanks
但是这个标签有字体、对齐方式的设置,但没有背景颜色选项!底部有“查看”部分,但它是空的。请告诉我在哪里可以找到背景颜色的设置?谢谢
采纳答案by Kyle Greenlaw
At the top select the attributes inspector. Under the section "View" there should be a spot that says "Background". click that and choose your colour.
在顶部选择属性检查器。在“查看”部分下应该有一个显示“背景”的地方。单击它并选择您的颜色。
(refer to image for help)
(参考图片获取帮助)
回答by Kyle Greenlaw
mylabel.backgroundColor = [UIColor redColor] ;
is the code to change the background color. You get the color name before "Color" from the names of colors in the Apple color palette.
mylabel.backgroundColor = [UIColor redColor] ;
是更改背景颜色的代码。您可以从 Apple 调色板中的颜色名称中获得“颜色”之前的颜色名称。
回答by Bala
Select the Label click on "Attribute Inspector" and scroll down you will see background option under View Section.
选择标签,单击“属性检查器”并向下滚动,您将在“查看部分”下看到背景选项。
Select label before you go to Attribute Inspector
在转到属性检查器之前选择标签