问题
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?
回答1:
The image should be a stretchable image so it can extend in either direction without breaking anything.
来源:https://stackoverflow.com/questions/11350976/ios5-uinavigationbar-background-image-issues-when-prompt-is-shown