Weird colors in XCode Interface Builder?

前端 未结 4 1907
忘了有多久
忘了有多久 2020-11-30 02:56

I have really weird problem with colors in interface builder. I set a color on one UI element, for example UIView, and then I want the same color on UIButton...but when I tr

相关标签:
4条回答
  • 2020-11-30 03:08

    The currently selected item in interface builder will be slightly different to its actual colour - it has a darkened mask applied to it to highlight the fact that it is selected. You need to click somewhere else in the window to unselect the item, it's real colour will then be shown. I've fallen into this trap myself.

    0 讨论(0)
  • 2020-11-30 03:09

    I solved this issue using "Device RGB" instead "Generic RGB". See the image:

    0 讨论(0)
  • 2020-11-30 03:17

    Interface Builder filters colors through your monitor's current color space by default. You can change this in Xcode4 IB by bringing up a Colors dialog, clicking the Sliders tab, then clicking the little dropdown button under the magnifying glass that looks like a color spectrum. This will bring up a list of available color spaces -- select Generic RGB and adjust the sliders as necessary to get the correct color.

    See this question for more information, especially the comments on the accepted answer.

    0 讨论(0)
  • 2020-11-30 03:24

    Unfortunately, fiddling with color spaces didn't work for me. What did work was editing the raw xml of the .xib (right click .xib, Open As > Source Code) and changing the RGB decimal values there.

    0 讨论(0)
提交回复
热议问题