iOS常用

iOS开发 点击tabbar、跳转新页面、不切换tab

2020-11-03  本文已影响0人  隔墙送来秋千影

主要用到的、、

<UITabBarControllerDelegate, UITabBarDelegate>

self.delegate = self;

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {
    if (viewController == self.viewControllers[1]) {
        //点击第二个tabbarItem,不切换tab,直接跳转
        IODetectionViewController *order = [[IODetectionViewController alloc] init];
        order.hidesBottomBarWhenPushed = YES;
        [(UINavigationController *)tabBarController.selectedViewController pushViewController:order animated:YES];
        return NO;
    }
    return YES;
}

上一篇 下一篇

猜你喜欢

热点阅读