Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UISplitViewController中的导航控制器消失_Ios_Swift_User Interface_Uinavigationcontroller_Uisplitviewcontroller - Fatal编程技术网

Ios UISplitViewController中的导航控制器消失

Ios UISplitViewController中的导航控制器消失,ios,swift,user-interface,uinavigationcontroller,uisplitviewcontroller,Ios,Swift,User Interface,Uinavigationcontroller,Uisplitviewcontroller,我目前在一个拆分视图控制器中设置了我的应用程序,这样详细视图和主视图都有导航控制器,而详细视图在它和另一个视图之间有递归分段。我使用show segues,因此我认为导航栏将位于显示的详细视图的顶部。但是,在激活两个分段后,导航栏消失,剩下的似乎是模态分段 下面是我的故事板设置示例的屏幕截图,它再现了问题: 以下是示例项目的链接: 有没有关于如何将导航栏保持在视图顶部的建议?您需要使用导航控制器,如 override func viewDidLoad() { super.

我目前在一个拆分视图控制器中设置了我的应用程序,这样详细视图和主视图都有导航控制器,而详细视图在它和另一个视图之间有递归分段。我使用show segues,因此我认为导航栏将位于显示的详细视图的顶部。但是,在激活两个分段后,导航栏消失,剩下的似乎是模态分段

下面是我的故事板设置示例的屏幕截图,它再现了问题:

以下是示例项目的链接:


有没有关于如何将导航栏保持在视图顶部的建议?

您需要使用导航控制器,如

   override func viewDidLoad() {
        super.viewDidLoad()
       buttonNext.addTarget(self, action: #selector(tapsOnNext), for: .touchUpInside)
    }
    func tapsOnNext(){
        let vc = self.storyboard?.instantiateViewController(withIdentifier: "NextViewController") as? NextViewController
        self.navigationController?.pushViewController(vc!, animated: true)
    }
&在
NextViewController
中使用

   buttonPrev.addTarget(self, action: #selector(tapsOnNext), for: .touchUpInside)
    }
    func tapsOnNext(){
        self.navigationController?.popViewController(animated: true)
    }


我不想弹出下一个视图控制器。当按下按钮时,我只想继续将它们添加到堆栈中。与Twitter或Facebook类似,在Twitter或Facebook上,您可以查看用户的个人资料,然后从那里单击另一个个人资料,然后再单击另一个个人资料,所有这些都会添加到视图堆栈中。然后使用
self.navigationController?.pushViewController(vc!,动画:true)
,但要注意导航堆栈。如果您的意思是要注意内存,我的数据是硬编码的,递归的最高级别是3。我只是想重复使用故事板视图,而不是像你在第一条评论中提到的那样制作3个副本(只需要三个堆栈),然后使用pop viewcontroller,很好,你可以继续。