奇怪的问题。
当我从故事板为UIView,UILabel或UIButton设置背景颜色时,它显示如下
但是当我使用如下编程设置背景颜色时,
customView.backgroundColor = //Same colour which I set in storyboard
对于相同的观看次数,显示如下:
检查相同RGB值的色差
此外,对于具有相同色调颜色和零背景图像的导航栏,它显示如下
self.navigationBar.setBackgroundImage(nil, for: .default)
self.navigationBar.barTintColor = UIColor.nbRedColor()
当我将半透明属性设置为false时,它如下所示:
self.navigationBar.isTranslucent = false
我理解导航栏不同颜色的东西是由于isTranslucent标志。但是为什么故事板和编程的背景颜色是不同的。
(编程的背景色是正确的)
Xcode版本8.3.3(在模拟器和多个设备中测试)