Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

navigationBar Background Image on iPad with iOS 5 in landscape mode

hemciihemcii Posts: 20Registered Users
edited October 2011 in iPhone SDK Development
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:

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
Sign In or Register to comment.