【发布时间】:2012-04-30 12:58:39
【问题描述】:
我正在尝试使用 iOS 5 中的外观方法来使用背景图像。我正在使用以下语句设置背景图像:
UIImage *portraitImage = [UIImage imageNamed:@"test_bar_portrait.png"];
UIImage *landscapeImage = [UIImage imageNamed:@"test_bar_landscape.png"];
[[UINavigationBar appearance] setBackgroundImage:portraitImage forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:landscapeImage forBarMetrics:UIBarMetricsLandscapePhone];
当我运行应用程序时,正确的图像显示为纵向和横向,但当我旋转回纵向时,它仍然显示横向图像。
我在这里创建了一个示例测试应用程序: http://dl.dropbox.com/u/7834263/Appearance%20Test.zip
以及正在发生的事情的屏幕截图:
【问题讨论】:
标签: iphone ios uiimage uiappearance