I find that when you set a view's backgroundColor in xib, the color displayed is distinctly different from when you set backgroundColor programmatically.
Here's an example.
I have two views in this simple demo. I set the upper view's backgroundColor in xib, like this:
The hex color value is 0x1BA9BA. Then I set the lower view's backgroundColor programmatically with the same hex color value. I use the following code:
NSInteger hexValue = 0x1ba9ba;
self.testView.backgroundColor = [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0
green:((float)((hexValue & 0xFF00) >> 8)) / 255.0
blue:((float)(hexValue & 0xFF))/255.0
alpha:1.0];
The result is as follows:
As you can see, there's a clear difference in color. What am I missing here?