Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 XCode/iOS 开发的新手,我想更改标签的背景颜色(XCode 5.0):
但是这个选项卡有字体、对齐方式的设置,但没有背景颜色选项!底部有“查看”部分,但它是空的。请告诉我在哪里可以找到背景颜色的设置?谢谢
在顶部选择属性检查器。在“视图”部分下应该有一个位置显示“背景”。单击它并选择您的颜色。
(参考图片寻求帮助)
mylabel.backgroundColor = [UIColor redColor] ;是更改背景颜色的代码。您可以从 Apple 调色板中的颜色名称中获得“颜色”之前的颜色名称。
mylabel.backgroundColor = [UIColor redColor] ;
选择标签单击“属性检查器”并向下滚动,您将在查看部分下看到背景选项。
在进入属性检查器之前选择标签