IOS7 navigatinBar tintColor change in popover

前端 未结 2 1218
情书的邮戳
情书的邮戳 2021-01-04 23:36

I developed iPad application. I\'m opening some screens in popover with navigation controller. But I did not change navigationcontroller tint color in IOS 7. How can I chang

相关标签:
2条回答
  • 2021-01-05 00:16

    The magical word here is barStyle, you need to do the following if you need it black:

    navigationController.navigationBar.barStyle = UIBarStyleBlack;
    navigationController.navigationBar.translucent = NO;
    

    And if you want to change its color:

    navigationController.navigationBar.barTintColor = [UIColor redColor];
    navigationController.navigationBar.barStyle = UIBarStyleBlack;
    navigationController.navigationBar.translucent = NO;
    
    0 讨论(0)
  • 2021-01-05 00:16

    Setting the NavigationBarStyle to UIBarStyleBlack also worked for me, but only via the Storyboard.

    I tried

    [[UINavigationBar appearance] setBarStyle:UIBarStyleBlack];
    

    as well as

    [[UINavigationBar appearanceWhenContainedIn:[UIPopoverController class], nil] setBarStyle:UIBarStyleBlack];
    

    in the didFinishLaunchingWithOptions AppDelegate method. But nothing changed. Only changing the BarStyle of the NavigationControllers NavigationBar inside the Storyboard worked.

    0 讨论(0)
提交回复
热议问题