I am trying to set the UINavigationBar background image:
I added in AppDelegate: (please note that it's one image)
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"general-top_bar_with_status.png"] forBarMetrics:UIBarMetricsDefault];
Since I don't need translucent, in the ViewController in ViewDidLoad I added:
self.navigationController.navigationBar.translucent = NO;
This is the image:
Unfortunately this is what I get:
As you can see, the image is upsite down.
What is wrong?
In storyboard, I set a place for TopBar - Opaque navigation bar
For iOS 7 you have to use 320x64 size navigation bar image
make picture 2X Size. with name [email protected]
Nav bar is Taking size of its self + status bar size. You may create only navbar size
640X88
or 640X128 for navbar + status bar
Then
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"mynavbar.png"] forBarMetrics:UIBarMetricsDefault];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With