我正在使用以下代码以编程方式更改选项卡(rootView):
NSInteger tabitem = tabBarController.selectedIndex;
[[tabBarController.viewControllers objectAtIndex:tabitem] popToRootViewControllerAnimated:YES];
但是当我想使用按钮从视图中更改选项卡时,我无法显示 rootView。我正在使用此代码,但它不显示 rootView:
self.tabBarController.selectedIndex = 3;