UITabbarItem间的快速跳转

应用中有多个Tabbar的时候,进行TabbarItme之间的相互跳转,是我们在开发中常常遇到的问题,当在一个tabbarItem的子视图控制器中,当点击某个按钮的时候,需要快速的跳转到另外一个tabbarItem之上,快捷的方式就是先通过导航控制器找到tabbarController,然后直接设置要跳到的tabbarItem的角标即可。代码如下:
- (BOOL)navigationShouldPopOnBackButton {
self.navigationController.tabBarController.selectedIndex = 3;
[self.navigationController popToRootViewControllerAnimated:YES];
return NO;
}

猜你喜欢

转载自blog.csdn.net/renjie_Yan/article/details/54950719