0

Strange Issue.

When I set background colour for UIView, UILabel or UIButton from Storyboard it is showing as below

enter image description here

But When I set background color using programming like below, customView.backgroundColor = //Same colour which I set in storyboard for same views, it is showing as below: enter image description here

Check Colour difference for same RGB values

Also, For navigation bar with same tint colour and nil background image it is showing like below

self.navigationBar.setBackgroundImage(nil, for: .default) self.navigationBar.barTintColor = UIColor.nbRedColor()

enter image description here

And when I set translucent property to false, it is shwoing as below: self.navigationBar.isTranslucent = false

enter image description here

I understand the navigation bar different colour thing is due to isTranslucent flag. But why is background colour of views from storyboard and programming is differnet.

(Background colour from Programming is correct one)

Xcode Version 8.3.3 (Tested in both simulator and multiple devices)

enter image description here

Kumar
  • 1,882
  • 2
  • 27
  • 44

1 Answers1

2

You can make it correct on the StoryBoard Also like this

Just Select Adobe RGB in that and paste your hex color in that box and you done!

if any issue please let me know..

enter image description here

Ravi Panchal
  • 1,285
  • 10
  • 22