iOS SDK Interface Builder的RGB滑块产生与UIColor withRGB不同的颜色 [英] iOS SDK Interface Builder's RGB slider producing different color than UIColor withRGB

查看:133
本文介绍了iOS SDK Interface Builder的RGB滑块产生与UIColor withRGB不同的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在界面构建器中,我将UILabel的颜色更改为此屏幕截图,其中红色255,绿色159,蓝色0和不透明度为100%。它给出了橙色。

In interface builder I changed the color of a UILabel to this screenshot, having Red 255, Green 159, Blue 0 and Opacity at 100%. which gives an orange color.


I以编程方式更改UILabel颜色,而不是使用此更改回原始颜色...

I programmatically change the UILabel color than change it back to the original color using this...

timeLabel.textColor = [UIColor colorWithRed:255.0 green:159.0 blue:0.0 alpha:1.0];

并且它给出了这种颜色....

and it gives this color....

我认为它应该是一样的,有谁知道我是什么做错了?
请帮助,谢谢。

I thought it should be the same, does anyone know what I'm doing wrong? please help, thanks.

推荐答案

timeLabel.textColor = [UIColor colorWithRed:255/255.0f green:159.0/255.0f blue:0.0/255.0f alpha:1.0];

这篇关于iOS SDK Interface Builder的RGB滑块产生与UIColor withRGB不同的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆