我想为iOS 6实现自定义的UINavigationBar图像背景,但我没有运气。它显示的是苹果公司的正常版本(没有后退按钮)。 我曾尝试下面的代码内viewDidLoad中(一个在时间):自定义UINavigationBar图像
[[UINavigationBar appearance] setBackgroundImage:myImage forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setBackgroundImage:myImage forBarMetrics:UIBarMetricsDefault];
我通过呈现所需的视图:
optionViewController *choose= [[optionViewController alloc] initWithNibName:@"optionViewController" bundle:nil];
UINavigationController *aNavController = [[UINavigationController alloc] initWithRootViewController:choose];
[self presentViewController: aNavController animated:YES completion:nil];
任何帮助,将不胜感激。谢谢!
发生什么事? [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@“barImage.png”] forBarMetrics:UIBarStyleDefault];此命令在我的代码中无处不在iOS5和iOS6中。 –
@LêQuýSang没有任何反应......它只是显示典型的基本UINaviationBar而不是我想要的图像。谢谢 –