如何在XCodes的界面生成器中定义颜色? [英] How to define colors in XCodes' Interface Builder?
问题描述
我想在Interface Builder中的元素之间复制颜色或使用RGB值定义它们。例如,我想将一个按钮的背景颜色复制到另一个按钮,而不重复按钮。
I would like to copy colors between elements in the Interface Builder or define them using RGB values. For example, I'd like to copy the background color of a button to another button without duplicating the button.
或者,在Interface Builder中输入准确的RGB代码就足够了;这样我可以确保我的按钮有完全相同的颜色。
Alternatively, entering exact RGB codes in Interface Builder would suffice; that way I can make sure my buttons have the exact same color.
目前我只知道如何做这个程序,但肯定有一种方法,在接口
Currently I only know how to do this programmatically, but surely there is a way to do it in Interface Builder?
推荐答案
要在IB中设置RGB值,应该
To set RGB value in IB you should
- 点击检查器窗口中相应的元素调用颜色对话框(例如背景颜色,文字颜色等)
- 在工具栏上选择 / li>
- 在组合框中选择RGB滑块。
现在您应该可以设置RGB值的颜色。
Now you should be able to set RGB values for the color.
对不起,我不知道是否可以轻松地在不同元素之间复制颜色值...
Sorry, I don't know if it is possible to copy color values between different elements easily...
这篇关于如何在XCodes的界面生成器中定义颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!