iphone - 需要在基于标签栏导航的应用程序中隐藏底部栏

标签 iphone ios tabbar viewcontroller navigationbar

我在基于 Tabbar 导航的应用程序中遇到问题。我有一个包含 3 个标签栏按钮项的标签栏。

每个选项卡栏项目,我需要显示导航 Controller 的 View 。当我点击第一个按钮时,我需要显示导航 Controller 的 Root View 。

我需要在推送导航 Controller 的 View 时,在一个 View 中显示标签栏。推送第二个 View 时,我需要隐藏标签栏。推送第三个 View 时,我需要再次显示标签栏。它也应该在弹出 View 时起作用。

在导航 Controller 的 Root View (主视图)中,我需要在底部显示标签栏。但是推了一个新 View (第一个 View )然后我需要隐藏标签栏。然后我将属性 hidesBottomBarWhenPushed 设置为 YES。

FirstViewController *firstController = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
firstController. hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:firstController animated:YES];

它在第一个 View 中运行良好。

但问题是当我推送一个新 View (第二个 View )时,即使我设置了属性也没有显示标签栏:

SecondViewController *secondController = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
secondController. hidesBottomBarWhenPushed = NO;
[self.navigationController secondController animated:YES];

最佳答案

让我知道这是否有效。

FirstViewController *firstController = [[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
//firstController. hidesBottomBarWhenPushed = YES;
[self.navigationController presentViewController:firstController animated:YES];

关于iphone - 需要在基于标签栏导航的应用程序中隐藏底部栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8757968/

相关文章:

ios - 在 tabbarcontroller 中更改选项卡时如何调用 Controller ? ( swift )

iphone - 覆盖 UIButton View 的背面

iphone - 尝试调试错误: *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:]

iphone - CFHTTPCookieGetCreateDate 在此操作系统版本 (iOS4) 中已弃用

iphone - iOS 通知中的本地化?

c++ - 如何在 cocos2d、iOS 中正确分配和释放 box2d 对象

iOS Coreplot实时数据

swift - Swift 中没有文本的中心选项卡栏图标

ios - 当标签栏点击两次时禁用自动弹出到 Root View Controller

ios - 使用 AVPlayer 将实时流的音轨静音