iOS5 UINavigationBar background image issues when prompt is shown

ios, uiappearance, uinavigationbar, uinavigationcontroller

Solution

The image should be a stretchable image so it can extend in either direction without breaking anything.

Problem

I am using the new appearance proxy in iOS 5 to style my UINavigationBar with a background image. ``` [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone]; ``` This works fine, but I need to set the prompt property of the nav bar. When I do that, the height of the nav bar increases, and my background image no longer fills that nav bar vertically, so it looks very bad. How can I account for the height change with a prompt when using a custom background image?

Original source