【发布时间】:2018-11-03 03:07:03
【问题描述】:
我正在尝试以编程方式在不同情节提要文件中的 UITabBarController 中启动 UIView。
在WelcomeVC.swift 中,它没有UITabBar 并且位于Main.storyboard 中。当单击 UIButton 时,它会调用 UITabBar ViewController
@objc func startMatching(sender: UITapGestureRecognizer){
let storyBoard: UIStoryboard = UIStoryboard(name: "Test", bundle: nil)
let pdv = storyBoard.instantiateViewController(withIdentifier: "AVC") as! AVC
self.present(pdv, animated: true, completion: nil)
}
在Test.storyboard 中,它包含1 个UITabBarController 和2 个视图控制器:AVC 和BVC。如果我们在它们上调用 present(),它们都会按预期运行,但 UITabBar 不会出现。
如何让标签控制器显示出来?
【问题讨论】:
标签: ios swift storyboard uitabbarcontroller