【发布时间】:2017-10-22 16:11:08
【问题描述】:
我有以下情况:
我有一个带有一些标签(ViewControllers)的 TabBarController。
当我在其中一个 ViewControllers 中时,我点击一个按钮,我想转到 NavigationController 并且仍然看到标签栏...
这是我所做的:
- 我创建了一个新的 ViewController(DetailViewController)
- 我在 NavigationController 中嵌入了这个新的 ViewController(DetailViewController)
- 我创建了一个从“嵌入在 tabbarcontroller 中的 viewcontroller”到“new navigationcontroller”的 segue(Show)
-
我编码:
func buttonTapped { performSegue(withIdentifier: "shownavicontroller", sender: nil } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { let destinationNavigationController = segue.destination as! UINavigationController let targetController = destinationNavigationController.topViewController as! DetailViewController }
出了什么问题:
- NavigationController 正在从下到上滑动...它应该从左到右滑动
- 缺少 NavigationController 中的 BackButton
- NavigationController 中的 TabBar 丢失...
有人可以帮我解决这个问题吗?
谢谢和问候!!
【问题讨论】:
-
您是否尝试过以下设置:
Tab Bar Controller -> Navigation Controller -> "viewcontroller which is embedded in the tabbarcontroller" -> Detail View Controller?这就是您通常使用UINavigationController...的方式...
标签: ios swift uinavigationcontroller uitabbarcontroller segue