- (BOOL)tabBarController:(UITabBarController*)tabBarController shouldSelectViewController:(UIViewController*)viewController {
if([viewControllerisKindOfClass:[UINavigationControllerclass]]) {
UINavigationController* nav = (UINavigationController*)viewController;
// 当UINavigationController中viewControllers大于1或当前页面正在被选中时,当前页tabbar禁止再点击
if([nav.viewControllerscount] >1&& tabBarController.selectedViewController== viewController) {
returnNO;
}
}
return YES;
}
网友评论