美文网首页iOS常用
iOS开发 点击tabbar、跳转新页面、不切换tab

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

作者: 隔墙送来秋千影 | 来源:发表于2020-11-03 17:55 被阅读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;
}

相关文章

网友评论

    本文标题:iOS开发 点击tabbar、跳转新页面、不切换tab

    本文链接:https://www.haomeiwen.com/subject/knrivktx.html