Reputation: 560
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 Taskbar
by using the color picker. However when I run the app I'm getting a completely different color as you can see below:
These are the settings for the view:
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?
Upvotes: 1
Views: 70
Reputation:
It has to do with the translucency of the bar, as explained in these answers.
You also have to consider that the view extends under the translucent bar, and the view's background color will slightly change the appearance of any translucent bars above it, because of the visual effect used by the bar.
You may want to not set a specific color for the status bar, and let it inherit the bar's color, to give the task bar and status bar a uniform appearance.
Upvotes: 1
Reputation: 8782
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];
Upvotes: 0