我开发了iPad应用程序。我正在使用导航控制器在弹出窗口中打开一些屏幕。但是我没有在IOS 7中更改Navigationcontroller的颜色。如何更改该颜色。谢谢
UINavigationController *navigationController = [[[UINavigationController alloc] initWithRootViewController:airportsSearch] autorelease];
navigationController.navigationBar.barTintColor = [UIColor blackColor];
navigationController.navigationBar.translucent = NO;
self.popOver=[[UIPopoverController alloc] initWithContentViewController:navigationController];
self.popOver.delegate = self;
[self.popOver setPopoverContentSize:CGSizeMake(285, 370)];
[self.popOver presentPopoverFromRect:tempButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
神奇的词是barStyle
,如果需要黑色,则需要执行以下操作:
navigationController.navigationBar.barStyle = UIBarStyleBlack;
navigationController.navigationBar.translucent = NO;
如果要更改其颜色:
navigationController.navigationBar.barTintColor = [UIColor redColor];
navigationController.navigationBar.barStyle = UIBarStyleBlack;
navigationController.navigationBar.translucent = NO;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句