我有这样的场景:
导航 Controller 中的一个选项卡栏。 在导航栏中有一个导航项(它是一个按钮)。 当我点击它时,我想显示一个模式 Controller ,该 Controller 在导航栏下方打开并覆盖选项卡栏。
我这样做了:
func tapButtonNavigationBar(){
let search = self.storyboard?.instantiateViewController(withIdentifier: "search) as! SearchController
self.present(search, animated: true, completion: nil)
}
但是,通过这段代码,新的“搜索” Controller 位于导航栏下方。 你能帮我吗?
最佳答案
我知道的一种方法是您可以添加指定帧的 subview 而不是 View Controller ,并使用动画打开相同的 subview 。
关于ios - 导航栏下的模态视图 Controller - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45525058/