【发布时间】:2020-07-13 01:44:15
【问题描述】:
我有六个 tabItem 视图控制器,每个子视图控制器都有自己的导航控制器。更改 selectedIndex 后,我无法推送新的视图控制器。我使用 AZTabBarController 创建了一个 tabbar 变量。
//the viewcontroller I want to push
let vc = self.storyboard?.instantiateViewController(withIdentifier: "CreateArticleViewController") as! CreateArticleViewController
//this can changing my tabbar selected index well.
self.currentTabBar?.setIndex(3, animated: true)
// Below code doesn't work
self.navigationController?.pushViewController(vc, animated: true)
self.currentnavigationController?.pushViewController(vc, animated: true)
tabcontroller -> 导航1 -> A1 -> A2
-> 导航 2 -> B1 -> B2 -> B3 -> B4
-> 导航 3 -> C1 -> C2 -> C3 -> C4
-> 导航 4 -> D1 -> D2 -> D3 -> D4
-> 导航 5 -> E1 -> E2 -> E3
-> 导航 6 -> F1 -> F2 -> F3
例如,当我在 A1 中点击一个按钮时,如何更改索引并将视图控制器推送到 D3? 我应该使用自定义委托来做到这一点吗? 请参阅我的故事板的快照。 https://imgur.com/a/X860m7p
【问题讨论】:
标签: swift uitabbarcontroller uitabbar