我正在实施基于iAdSuite中TabbedBanner示例的设计。我在第一个选项卡中有一个UINavigationController。在那个UINavigationController中,我有一个视图控制器,它只是有一个按钮被推送到另一个视图控制器。推送的视图控制器设置为在推入界面生成器中隐藏底部条。BannerViewController干扰hidesBottomBarWhenPushed
这里是我设置UITabBarController的代码。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:[[NSBundle mainBundle].infoDictionary objectForKey:@"UIMainStoryboardFile"] bundle:[NSBundle mainBundle]];
_tabBarController = [storyboard instantiateViewControllerWithIdentifier:@"TabBarController"];
_tabBarController.delegate = self;
FirstViewController *firstView = [storyboard instantiateViewControllerWithIdentifier:@"FirstViewController"];
UINavigationController *firstNav = [[UINavigationController alloc] initWithRootViewController:firstView];
_tabBarController.viewControllers = @[[[BannerViewController alloc] initWithContentViewController:firstNav], ];
self.window.rootViewController = _tabBarController;
[self.window makeKeyAndVisible];
return YES;
}
当我推送到下一个视图控制器时TabBar不会隐藏。我试图使用界面生成器复选框隐藏TabBar以及使用nextViewController.hidesBottomBarWhenPushed = YES,这两种方法都不起作用。
如果我删除了BannerViewController实现,TabBar完全按照它应该隐藏的那样。 在我看来,BannerViewController干扰UINavigationController能够隐藏TabBar。
是否有可能使用隐藏底栏当推送隐藏TabBar在这种类型的设置?
谢谢
注意:我知道上面的代码只有一个选项卡。为了清晰起见,我删除了其他标签。
你是如何解决这个问题的? – SAHM 2014-08-21 01:26:38
我从来没有得到它的工作。我真的很惊讶,我从来没有在这个问题上得到任何答案。我应该再看看它。 – 2014-08-21 13:37:34