【发布时间】:2016-01-08 06:05:54
【问题描述】:
我需要将背景图片添加到导航栏,我完成了代码,但它显示在状态栏下方。如何在导航栏上完全显示图像。(iOS 8)。
我用于导航栏背景图片的代码是
UIImage *navBarBackgroundImage = [UIImage imageNamed:@"NavigationBarImg"];
[[UINavigationBar appearance] setBackgroundImage:navBarBackgroundImage forBarMetrics:UIBarMetricsDefault];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
【问题讨论】:
-
你的图片尺寸是多少
-
使用320x64的图片尺寸
-
是的,它奏效了。谢谢
标签: objective-c uinavigationcontroller uinavigationbar ios9.1 xcode7.1