Navigation Controller Transparent Bar Style is not working

前端 未结 12 636
情书的邮戳
情书的邮戳 2020-12-31 13:57

I am using a navigation controller, and I have the style set to :

navController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

But wh

相关标签:
12条回答
  • 2020-12-31 14:10

    I had the same problem, and I solved it by making the background of the root view the same as my view. The white area behind the navigation bar turned out to be the root view.

    0 讨论(0)
  • 2020-12-31 14:11

    Try this:

    self.tabBarController.tabBar.superview.backgroundColor = [UIColor blackColor];
    
    0 讨论(0)
  • 2020-12-31 14:14

    Change the Extend Edges options in child viewControllers

    As for example, in xcode editor, go to your first viewcontroller child and unset the options:

    Extend Edges;
        Under Top Bars;
        Under Bottom Bars;
        Under Opaque Bars;
    

    This way your child ViewController will not layout starting below the status bar of the navigation controller, neither the tabbar or the toolbars

    hope it may help anyone

    0 讨论(0)
  • 2020-12-31 14:15

    I had a same problem.I solved!

    ImageViewExtendController *detailImageController = [[ImageViewExtendController alloc] init];  
    [detailImageController loadImage:url];
    [self.navigationController pushViewController:detailImageController animated:YES];
    
    0 讨论(0)
  • 2020-12-31 14:16

    You need to set the barstyle in your info.plist file for it offset everything correctly.

    However, I haven't tried it since the 2.1 f/w was released, but when I tried this in 2.0 I found that the setting was lost after a rotation from portrait to landscape.

    0 讨论(0)
  • 2020-12-31 14:17
    self.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.169 green:0.373 blue:0.192 alpha:0.9];
    self.navigationController.navigationBar.translucent = YES;
    

    Note:

    1. Don't use self.navigationBarStyle and self.navigationBarTintColor to change.
    2. Add the last two statements to your viewDidLoad.
    0 讨论(0)
提交回复
热议问题