Navigation bar is moving up to statusbar

こ雲淡風輕ζ 提交于 2019-11-28 14:21:01

I believe you trying to hide navigationBar in firstVC and show it in secondVC.

Try following method into your firstVC and make sure you embedded your firstVC with navigationController.

Your storyBoard flow layout should be look like below...

Implement below method in firstVC.

override func viewWillAppear(_ animated: Bool) {

    self.navigationController?.setNavigationBarHidden(true, animated: true)
}

override func viewWillDisappear(_ animated: Bool) {

    self.navigationController?.setNavigationBarHidden(false, animated: true)   
}

Output:Updated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!