0

Hidden the navigation bar in ViewWillAppear

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

but when clicking on top of the viewcontroller navigationbar shows up. Did anyone faced this issue ?

skkrish
  • 287
  • 4
  • 23

2 Answers2

1

Solved issue, need to disable the barHideOnTapGestureRecognizer property cause of slop area on the UINavigationBar, link for answer https://stackoverflow.com/a/37595538/3282447

Community
  • 1
  • 1
skkrish
  • 287
  • 4
  • 23
0

I dont know this one is correct or not. But its working fine for me.

override func viewWillAppear(_ animated: Bool) 
{
  super.viewWillAppear(animated)
  self.navigationController?.navigationBar.isTranslucent = false
  self.navigationController?.setNavigationBarHidden(true, animated: false)
}
  • its hiding initially, but once i click on top of viewcontroller, navigation bar showing. – skkrish Apr 20 '17 at 11:03
  • Check your entire code because navigation bar enabled somewhere of the class otherwise Could you please provide your class files or project. Then only I would be able to find the solution. – arunprasath sivasamy Apr 20 '17 at 14:06
  • Solved the issue by disabling the barHideOnTapGestureRecognizer property, thanks for your time. – skkrish Apr 20 '17 at 16:21