我知道关于此主题的许多问题,但所有解决方案似乎都不起作用。
我想在当前视图上实现一个“后退按钮”,即DetailViewController,当按下该按钮时将加载初始视图控制器。
因此,在这个DetailViewController的导航栏中,我添加了一个Bar Button项,并为其指定了IBAction,如下所示:
@IBAction func backToCenter(sender: AnyObject) {
self.storyboard?.instantiateInitialViewController()
}
但是当我打开详细视图时,后退按钮不会出现
我认为类似问题的答案之一中没有提到空间问题,其中项目从右到左排列,如果没有足够的可用空间,则它们不可见。
Cutting the story short, Pls help me get the Back button on the DetailViewController..
Update:
I already have a navigatorcontroller between my TableView and DetailView Controllers:
See the snap of my storyboard:
You have to set the Navigationcontroller before your TableViewController and not after your controller. That way your back button will work.
Like that:
Start-TableViewcontroller -> NavigationController -> Second Tableviewcontroller -> Viewcontroller
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句