[英]UINavigationBar setBackgroundImageForBarMetrics doesn't work in iOS 7
i'm trying to se an image for the background of the navigation bar, and i'm doing this like i do in iOS6: 我正在尝试为导航栏的背景设置图像,并且像在iOS6中一样执行此操作:
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"Navbar.png"] forBarMetrics:UIBarMetricsDefault];
this is the image: 这是图像:
and this is the result when i run: 这是我运行时的结果:
on iOS 6 works perfect, instead on iOS 7 have that problem... 在iOS 6上可以完美运行,而在iOS 7上则存在该问题...
尝试将其添加到导航控制器中:
self.navigationController.navigationBar.tintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Navbar.png"]];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.