我有以下代码应该在我的导航栏上设置背景图像。
if ([self.navigationController.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] )
{
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-background"] forBarMetrics:UIBarMetricsDefault];
}
else
NSLog(@"WTF");
它适用于 iPad,但不适用于 iPhone,在 iPhone 上它记录 WTF ..... 没有 if 语句的相同结果。我的 iPhone 是运行 ios 6.0 的 iPhone 4,iPad 是运行 ios 6.0 的 iPad 2
任何帮助表示赞赏。
谢谢,