显示提示时,iOS5 UINavigationBar背景图像问题

时间:2012-07-05 19:11:30

标签: ios uinavigationcontroller uinavigationbar uiappearance

我在iOS 5中使用新的外观代理来为我的UINavigationBar设置背景图像样式。

[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationBG.png"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"ZSNavigationLandscapeBG.png"] forBarMetrics:UIBarMetricsLandscapePhone];

这很好用,但我需要设置导航栏的提示属性。当我这样做时,导航栏的高度增加,我的背景图像不再垂直填充该导航栏,所以它看起来很糟糕。

使用自定义背景图像时如何通过提示说明高度变化?

1 个答案:

答案 0 :(得分:4)

图像应该是stretchable image,因此它可以向任一方向延伸而不会破坏任何东西。