替换 TabBarControlller 中选项卡的 ViewController
Replace ViewController of a tab in a TabBarControlller
我有一个 TabBarController 和 4 个选项卡,它们各自的 ViewControllers(嵌入在 NavigationController/TableViewController 中)是使用界面创建的。在 ViewController1 上动态添加了多个 BarButton。
Tab 1 的当前视图控制器必须在单击 BarButton 时被替换。我该怎么办?
这是您应该尝试的片段,以便更好地掌握它
self.tabBarController.selectedIndex = 1;
这个问题我之前也回答过,你也可以参考那个回答
[self.tabbarController setViewControllers:arrayOfNewViewControllers];
self.tabbarController.selectedIndex = 0;
我有一个 TabBarController 和 4 个选项卡,它们各自的 ViewControllers(嵌入在 NavigationController/TableViewController 中)是使用界面创建的。在 ViewController1 上动态添加了多个 BarButton。 Tab 1 的当前视图控制器必须在单击 BarButton 时被替换。我该怎么办?
这是您应该尝试的片段,以便更好地掌握它
self.tabBarController.selectedIndex = 1;
这个问题我之前也回答过,你也可以参考那个回答
[self.tabbarController setViewControllers:arrayOfNewViewControllers];
self.tabbarController.selectedIndex = 0;