美文网首页
ios xib和storeboard设置颜色和代码设置偏差处理

ios xib和storeboard设置颜色和代码设置偏差处理

作者: xh_0129 | 来源:发表于2020-08-22 19:49 被阅读0次

问题:
代码设置色值方法:

define HexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue&0xFF0000)>>16))/255.0 green:((float)((rgbValue&0xFF00)>>8))/255.0 blue:((float)(rgbValue&0xFF))/255.0 alpha:1.0]

xib中同样设置该色值,在手机上会出现偏差。

一、问题所在:


展示效果

二、原因分析:
xib或者storestoryboard设置颜色时,RGB Sliders的Color Profile默认是Generic RGB形式的,

三、解决方案:
使用xib或者storestoryboard设置颜色时,设置Color Profile如下:


设置

四、完美解决。

相关文章

网友评论

      本文标题:ios xib和storeboard设置颜色和代码设置偏差处理

      本文链接:https://www.haomeiwen.com/subject/pttbjktx.html