1
votes

In my rootViewController i have hidden status bar. When i tried to push the new viewcontroller and pop back, then navigation bar is pushed up and there is the gap between navigation bar and content view. Here are the screenshot of navigation bars.Navigation bar while transitionBefore transition

Here is the code in rootViewController

 override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)
    self.statusBarHidden = true
    self.navigationController?.setNavigationBarHidden(true, animated: true)
}

private var statusBarHidden = true {
    didSet {
            self.setNeedsStatusBarAppearanceUpdate()
    }
}

override var prefersStatusBarHidden: Bool {
    get {
        return statusBarHidden
    }
}
1
Why are you hiding your navigation bar in the code?Timmy
@Timmy Because i need to hide both navigation bar and status barsant05
So the problem is that the navigation bar isnt hiding in the view controller first picture you showed?Timmy
@Timmy First picture is during the pop transition using interactivePopGestureRecognizer and the problem is navigationbar moves up becuase I m hiding status bar in rootviewcontroller(blue one).sant05

1 Answers

0
votes

I resolved this issue by adding the following line to -viewDidLoad:

extendedLayoutIncludesOpaqueBars = true