展开时显示TopBar NavigationController

时间:2014-07-18 17:36:44

标签: ios uinavigationcontroller uitabbarcontroller stack-unwinding

目前我正在使用Unwind来访问其路径的主视图。

这是我在Sender ViewController上的代码:

- (IBAction)showRecents:(UIStoryboardSegue *)segue {

[self.navigationController.tabBarController setSelectedIndex:1];
NSLog(@"Root of Navigation Executed");
}

这是展开之前的样子

enter image description here

这就是它从源视图控制器展开后的样子:

enter image description here

问题是我不明白为什么它没有展示绿色TopBar?与TabBarController有关吗?

这是我的Path VC:

enter image description here

1 个答案:

答案 0 :(得分:0)

这个问题的答案是。首先,我们需要在Source ViewController上隐藏/显示NavigationController,然后它才会消失我们需要再次显示它。在发件人ViewController上的那种方式您将能够看到导航,因为它被设置为在展开其执行的源上显示。

-(void)viewWillAppear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:YES];
}

-(void)viewWillDisappear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:NO];
}