【发布时间】:2017-09-04 04:35:46
【问题描述】:
我正在努力实现我认为是一项简单的任务,但是尽管这里有类似的帖子得到了回答,但解决方案却让我望而却步....
我在 Xcode 8/swift 3 中使用 Main.storyboard 创建一个应用程序,其初始 ViewController 为 UINavigationController。然后我想推送到UITabBarController,它有两个与之有关系的视图控制器:
override func viewDidLoad() {
super.viewDidLoad()
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
if let vc = mainStoryboard.instantiateViewController(withIdentifier: "test") as? UITabBarController {
self.navigationController?.pushViewController(vc, animated: true)
}
}
启动应用程序时,初始 ViewController 成功“推送”到 TabBarController/它的 ViewControllers(下图)。我遇到的问题是在 TabBarController ViewControllers(在 Storyboard 中或以编程方式)中添加导航项/按钮后,按钮/导航项永远不会显示。
我看过一些帖子,例如下面的链接,并逐字按照建议的步骤进行操作,但没有解决问题。任何帮助将不胜感激!
Adding buttons to navigation controllers How to add buttons to navigation controller visible after segueing?
【问题讨论】:
标签: swift uinavigationcontroller uibutton storyboard xcode8.2