Interface Builder 颜色与代码颜色不同
我所缺少的有什么不同。我以前没有注意到这一点,或者我在做一些愚蠢的事情......
在界面生成器中获得了一个视图,使用 RGB 滑块 44、44、44 设置其背景颜色。不透明度 1。设置为不透明。
当我运行该应用程序时,它已将其更改为 33, 33, 33 ????
如果在视图中出现,我使用...更改它
self.topView.backgroundColor = [UIColor colorWithRed:44.0f/255.0f green:44.0f/255.0f blue:44.0f/255.0f alpha:1.0f];
......然后一切都好。
这是在做什么?
任何颜色都会发生这种情况。如果我选择 200, 250, 5 - 我运行应用程序,它已更改为 200, 120, 5 ???
What is different here that I'm missing. I haven't noticed this before, or I'm doing something stupid.....
Got a view in interface builder, set its background colour using RGB sliders 44, 44, 44. Opactity 1. Set as opaque.
When I run the app, it has changed it to 33, 33, 33 ????
If in the view will appear, I change it using....
self.topView.backgroundColor = [UIColor colorWithRed:44.0f/255.0f green:44.0f/255.0f blue:44.0f/255.0f alpha:1.0f];
..then everything is ok.
What is doing this?
It happens with any colour. If i choose 200, 250, 5 - i run the app and it has changed to 200, 120, 5 ????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我必须选择正确的色彩空间...
感谢 Ken 在这篇文章中的评论
其他问题:
I had to choose the correct colorspace...
Thanks to a comment by Ken from this post
Other question:
在 Interface Builder 中,确保将不透明度设置为 100%,而不是 1%。 (您的问题表明您将其设置为 1。)
In Interface Builder, be sure you're setting the opacity to 100%, not 1%. (Your question states that you're setting it to 1.)