【发布时间】:2017-12-23 06:25:40
【问题描述】:
我想推送我的导航控制器,但我得到了:pushing a navigation controller is not supported
我无法实例化我的 TableView。
这是我的代码:
let newViewController = storyboard!.instantiateViewController(withIdentifier: "player") as! UINavigationController
self.navigationController?.pushViewController(newViewController, animated: true)
那么有办法推送 NavigationController 吗?
【问题讨论】:
-
你不能推送导航控制器。你可以推送你的tableviewcontroller。
-
navigationController 应始终显示或设置为根控制器,为什么要这样做,以及为什么不直接将 tableviewcontrolller 推送到当前导航控制器
-
为什么不能将 tableview 控制器作为导航控制器的根视图控制器并在不需要时隐藏导航栏。然后您将能够在选择任何单元格时推送第二个控制器。
-
@Ellen 我不知道该怎么做
标签: ios swift uitableview swift3 uinavigationcontroller