iOS5 UINavigationBar background image issues when prompt is shown

徘徊边缘 提交于 2019-12-22 09:38:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!