我有一个uipageviewcontroller,我正在从其他视图控制器推送 以下代码:-
self.navigationController?.pushViewController(rideDetailsPageViewController, animated: true)
当我尝试在uipageviewcontroller中滑动时,会显示导航栏。如何预防呢?
答案 0 :(得分:1)
如果要隐藏导航栏,请使用以下rideDetailsPageViewController
的代码方法
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.isNavigationBarHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.isNavigationBarHidden = false
}