繁体   English   中英

从UIViewController切换到UINavigationController丢失选项卡栏

[英]switch from UIViewController to UINavigationController losing tab bar

我需要从UIViewController导航到UINavigationController,下面的代码做到了,但是切换之后,底部的选项卡栏消失了,我得到了库存!

HomeViewController *homeList = [self.storyboard instantiateViewControllerWithIdentifier:@"homeList"];
UINavigationController *uc = [self.storyboard instantiateViewControllerWithIdentifier:@"homeNav"];
uc = [[UINavigationController alloc] initWithRootViewController:homeList];
[self presentModalViewController:uc animated:YES];

问题应该在presentModal中,但我不知道该如何管理。 我是Objective C和iOS开发的新手。

这是因为您已将其显示为模态控制器,所以不会显示选项卡栏。 设计使用模态控制器来显示屏幕,该屏幕会中断当前工作流程以显示一些新信息,有关模态控制器的工作原理,请参见此处

http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewControllerPGforiOSLegacy/ModalViewControllers/ModalViewControllers.html

如果您需要导航控制器,那么使用导航控制器而不是viewController初始化选项卡控制器肯定更有意义,那么您可以使用来从一个屏幕切换到下一个屏幕

[self.navigationController pushViewController:someController animated:YES];

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM