我可以在滑动手势时修复 UINavigationBar 的 TopBar 吗
Can i fixed UINavigationBar's TopBar on the way swipe gesture
我想要UINavigationBar的Topbar在滑动手势的路上。
我的故事板是这样的:
LoginViewController(UINavigationController) =>(pushViewController) RegisterViewController
我尝试了一些方法,最相似的答案是
- LoginViewController 的导航栏设置为隐藏。
setNavigationBarHidden(true, animated: true)
- RegisterViewController 的导航栏设置为显示。
self.navigationController?.setNavigationBarHidden(false, animated: true)
但是,此方法必须将LoginViewController的导航栏设置为隐藏。
还有别的好方法吗?
结果)https://puu.sh/Ei30r/14dc30d883.jpg
我要)https://puu.sh/Ei32K/437b731c80.jpg
用 link 替换 img 标签,因为我没有至少 10 个声誉。
对不起,
我已经试过了,它成功了。你可以试试看。
在 LoginViewController 的
override func viewWillAppear(_ animated: Bool) {
navigationController?.setNavigationBarHidden(true, animated: true)
}
在 RegisterViewController 的
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: true)
}
我想要UINavigationBar的Topbar在滑动手势的路上。
我的故事板是这样的:
LoginViewController(UINavigationController) =>(pushViewController) RegisterViewController
我尝试了一些方法,最相似的答案是
- LoginViewController 的导航栏设置为隐藏。
setNavigationBarHidden(true, animated: true)
- RegisterViewController 的导航栏设置为显示。
self.navigationController?.setNavigationBarHidden(false, animated: true)
但是,此方法必须将LoginViewController的导航栏设置为隐藏。
还有别的好方法吗?
结果)https://puu.sh/Ei30r/14dc30d883.jpg
我要)https://puu.sh/Ei32K/437b731c80.jpg
用 link 替换 img 标签,因为我没有至少 10 个声誉。
对不起,
我已经试过了,它成功了。你可以试试看。
在 LoginViewController 的
override func viewWillAppear(_ animated: Bool) {
navigationController?.setNavigationBarHidden(true, animated: true)
}
在 RegisterViewController 的
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: true)
}