我试图在UINavigationController中推送TabBarController
但是只要我按下显示器没有导航栏的第一个控制器,只要我使用标签栏按钮在其他屏幕上导航它显示,我尝试在标签栏的登录页面上手动添加它,如下所示:
self.navigationController?.navigationController?.setNavigationBarHidden(false, animated: false)
let barItem = UIBarButtonItem(image: UIImage(named: "upload"), style: UIBarButtonItemStyle.Plain, target: self, action: Selector("cameraTap"))
self.navigationController?.navigationBar.topItem?.rightBarButtonItem = barItem
self.navigationController?.navigationBar.topItem?.title = "welcome to the jungle"
这就是我调用TabBarController的方式
func startApp(){
let sb = UIStoryboard(name: "Main", bundle: nil)
let overviewVC = sb.instantiateViewControllerWithIdentifier("TabBarController") as! UITabBarController
overviewVC.navigationItem.setHidesBackButton(true, animated: false)
if logInController != nil{
logInController.dismissViewControllerAnimated(true, completion: nil)
}
overviewVC.selectedIndex = 0
self.navigationController?.pushViewController(overviewVC, animated: true)
}
我也尝试将它分配给self.navigationController.tabBarController
,但它似乎只是读取到目前为止没有运气。
查看组织:
Nav Contr -> View Contr -> Tab Contr -> View Contr 1
-> View Contr 2
-> View Contr 3