Im struggling with this for a while and i cant find anyone with a related issue. My problem is that the background image that gets loaded on for the landscape mode on the iPad its not the correct one (it loades the portrait version of the image as seen
here). On the iphone or iPod it work as its supposed to.
The code im using on my AppDelegate file is the following:
Code:
if ( [[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0 ) {
// Create resizable images
UIImage *gradientImageP = [[UIImage imageNamed:@"header"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
UIImage *gradientImageL = [[UIImage imageNamed:@"header-Landscape"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearance] setBackgroundImage:gradientImageP
forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:gradientImageL
forBarMetrics:UIBarMetricsLandscapePhone];
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlackTranslucent];
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:0 green: 0 blue:0 alpha:1]];
}
Screenshots of the problem on the navigation bar:
My images names are the following:
- header-Landscape~iphone.png
- header-Landscape@2x~iphone.png
- header-Landscape~ipad.png
- header~iphone.png
- header@2x~iphone.png
- header~ipad
I already tryed using the solution with if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad), and event tought the background image on the landscape gets loaded, on portrait mode, that same img gets loaded as well so this doesnt work.
Anyone with this issue? Im open to ideas on how to solve this, tkz