I am trying to use a background image using the appearance methods in iOS 5. I’m setting the background images with these statements:
UIImage *portraitImage = [UIImage imageNamed:@"test_bar_portrait.png"];
UIImage *landscapeImage = [UIImage imageNamed:@"test_bar_landscape.png"];
[[UINavigationBar appearance] setBackgroundImage:portraitImage forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:landscapeImage forBarMetrics:UIBarMetricsLandscapePhone];
When I run the app, the correct image appears in portrait and landscape, but when I rotate back to portrait, it still has the landscape image shown.
I created a sample test application here: http://dl.dropbox.com/u/7834263/Appearance%20Test.zip
And screen shots of what is happening: