I am developing and iOS app with both positions, Landscape and Portrait.
Using iOS5, I Would like to set a Background image to a custom UINavegationBar.
I used that:
if([self.navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] ) {
[self.navBar setBackgroundImage:[UIImage imageNamed:@"TabBarContactsPort.png"] forBarMetrics:UIBarMetricsDefault];
[self.navBar setBackgroundImage:[UIImage imageNamed:@"TabBarContactsLand.png"] forBarMetrics:UIBarMetricsLandscapePhone];
}
I write this code at the viewDiLoad method, and it works ok for Portrait but use the same image for Landscape mode.
Please, help me and thaaanks.
Set the background image conditionally as follow:
Hope it helps.