Search code examples
ioscolorsstatusbar

iPhone not displaying accurate color


I'm working on a simple WebView app where I want the Statusbar to be the same color as the Taskbar from the website.

What I did was setting the background color of the View to the same color as the Taskbarby using the color picker. However when I run the app I'm getting a completely different color as you can see below: enter image description here

These are the settings for the view:

enter image description here

The color code of the Taskbar is: #242424 However the color code the statusbar gets is: #1b1b1b even though I've selected the #242424 color via the color picker.

Why does it seem to do this?


Solution

  • Xcode Colour picker not pick exact same colour. Try this macro(set your colour code)

    #define CODE_1_COLOR   [UIColor colorWithRed:(140.0f/255.0f) green:(132.0f/255.0f) blue:(124.0f/255.0f) alpha:1.0f] 
    

    Also take care about Translucent property in case of navigation bar

     [[UINavigationBar appearance] setTranslucent:NO];