![](/img/trans.png)
[英]MFMailComposeViewController and dark bar's tintColor in iOS7
[英]IOS7 navigatinBar tintColor change in popover
我開發了iPad應用程序。 我用導航控制器在popover中打開一些屏幕。 但我沒有在IOS 7中更改導航控制器色調顏色。如何更改此顏色。 感謝名單
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;
將NavigationBarStyle設置為UIBarStyleBlack也適用於我,但只能通過Storyboard。
我試過了
[[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
以及
[[UINavigationBar appearanceWhenContainedIn:[UIPopoverController class], nil] setBarStyle:UIBarStyleBlack];
在didFinishLaunchingWithOptions AppDelegate方法中。 但沒有改變。 只有改變NavigationControllers導航欄的BarStyle里面的故事板工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.