iOS - UINavigationController, Hide navigationBar

前端 未结 5 1656
醉话见心
醉话见心 2021-02-20 15:52

I have a minor trouble hiding the navigationBar for my UINavigationController

I have added:

self.navigation!.navigationBar.hidden = true
<
相关标签:
5条回答
  • 2021-02-20 16:01

    Look at this site: https://developer.xamarin.com/recipes/ios/content_controls/navigation_controller/make_the_nav_bar_disappear/

    This site says that "The behavior is slightly different depending on whether the Nav Bar is opaque or translucent"

    I hope it is helpful.

    0 讨论(0)
  • 2021-02-20 16:05

    I know the question has already been answered but I was having the same issue when hiding a navigation bar then using a UIScrollView in the view.

    I fixed it programmatically using:

    self.edgesForExtendedLayout = UIRectEdgeNone;
    

    Or in interface builder by deselecting all of these:

    0 讨论(0)
  • 2021-02-20 16:09
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    
    0 讨论(0)
  • 2021-02-20 16:13

    Updated :

    Just add this in you ViewDidLoad method

    self.automaticallyAdjustsScrollViewInsets = NO;
    
    0 讨论(0)
  • 2021-02-20 16:18

    You can use hide navigation bar like

    [self.navigationController setNavigationBarHidden:YES];
    

    Hide status bar

    // Hide status bar iOS 7 or later
    - (BOOL)prefersStatusBarHidden
    {
        return YES;
    }
    
    0 讨论(0)
提交回复
热议问题