I am customizing a UINavigationBar like so:
UIImage * img = [UIImage imageNamed:@"background.png"];
[[UINavigationBar appearance] setBackgroundImage:img forBarMetrics:UIBarMetricsDefault];
My original image background.png
looks like this:
It has a flat color #4b0367
The resulting NavigationBar looks like this:
It has the color #311253
which is different from the original!
Apparently UIKit changes the color.
Note:
- Setting
tintColor
had no effect. - Setting a transparent background image + a color is not an appropriate solution in my case.
Does anybody know how the underlying mechanism works? How can I get the original image to appear correctly?
application:didFinishLaunchingWithOptions:
, so in AppDelegate. – Henryk