2016-11-10 107 views
1

我的iPhone应用程序显示带有3个选项卡的Tab键 - 单击按钮。 它与最初的3个UIViewControllers工作正常。 但是当我尝试在任何TAB中推送新的UIViewController时,选项卡栏消失。 我甚至在这里http://stackoverflow.com/questions/31087181/tab-bar-controller-is-not-in-all-uiviewcontrollers 尝试过其他的解决方案提但是我只能看到不带标签栏的选项空白......如何在所有UIViewControllers中显示选项卡栏控制器

enter image description here

我想没有导航推的UIViewController像正常的方式。我 也推动从标签栏UIViewController(具有导航控制器为UIViewController),但任何方式不给我想要的结果。 我不想要两个导航项目或不带标签栏的新视图。

所有UIViewController的应在导航和标签栏中显示。

请帮

注:我从点击按钮加载的TabBar在回家的UIViewController像下面

-(IBAction)btnReceivePressed:(id)sender 
{ 
    TabBarViewController *about_vc = (TabBarViewController*)[[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"TABBAR"]; 
    [[self navigationController] pushViewController:about_vc animated:YES]; 
} 

是屏幕截图,在显示两个导航项目.. enter image description here] 3 [enter image description here] [4 enter image description here

+0

如果按,使用TabBar应该坚持,除非你检查了'隐藏在他们 – Tj3n

回答

2

尝试此的UIViewController集属性:

enter image description here

两个导航栏的另一个解决方案

您需要appdelgate如下改变:

来源:

UINavigationController *naController =[[UINavigationController alloc ]initWithRootViewController:self.tabBarController]; 
    naController.navigationBarHidden = NO; 
    self.window.rootViewController = naController; 

有了:

self.window.rootViewController = self.tabBarController; 

方案三如果你是使用推。

- (IBAction)btnReceivePressed:(id)sender { 
    TabBarViewController about_vc = (TabBarViewController) 
    [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"TABBAR"]; 
    [self navigationController].navigationBarHidden = YES; 
    [[self navigationController] pushViewController:about_vc animated:YES]; 
} 
+0

没有用push'选项底部工具栏,导航栏标题来下面..like两个导航项目将发布屏幕短裤... – user2813740

+0

附加问题中的屏幕截图。 – KKRocks

+0

完成请检查 – user2813740

相关问题