我一直致力于从单个UITabBarController
链接多个故事板。我让它工作,我可以打开新的故事板并显示初始UIViewController
,只有UITabBar
在打开新故事板时消失。
以下是我用来切换到新故事板的代码:
-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
if ( [viewController isMemberOfClass:[ProfileRedirectViewController class]] )
{
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Profile" bundle:nil];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"ProfileTableViewController"];
[self.view.window.rootViewController presentViewController:vc animated:YES completion:nil];
//[self.navigationController pushViewController:vc animated:false];
return NO;
}
return YES;
}
我一直在使用navigationController
版本,但它什么都不做,导致死点击,日志中没有错误。我一直在寻找一个答案,也许我已经走错了路。我是xcode的新手,所以我很可能会遗漏一些明显的东西,或者使用不稳定的搜索词找到帮助。
当我们导航到主故事板中的任何其他视图时,UITabBar
工作正常,只有当我移动到下一个故事板时才会丢失它。
非常感谢所有帮助!
答案 0 :(得分:0)
您告诉视图窗口加载新的根,但您想要做的是让UIBarTab打开另一个故事板。看看他的帖子有一个非常好的详细答案:Proper Way to Open a New Storyboard through UITabBarController