简体   繁体   中英

Using constants in Nib files

I have an App with few Nibs, the Nibs are built according to a color scheme. Now I have a requirement to change the color scheme. So I need to go to each Nib, and each component in it and change its color.

I was wondering whether I can tell the Nib to read the color from a "#define" so it would be easy to make these kind of changes in the future.

Or any other way to change the Nib content not by going to each Nib and changing it but by doing it is a central place.

There is currently no way to use constants or defined symbols inside the context of a Nib file. You should consider filing an enhancement request with Apple at http://bugreporter.apple.com for this functionality.

不适合为每个需要颜色自定义的元素设置IBOutlet ,然后在代码中设置颜色?

即使在使用其他颜色创建笔尖之后,您仍然可以更改其背景颜色的值,例如viewDidLoad函数或任何其他函数中的#define-ed值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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