【发布时间】:2012-10-29 11:07:57
【问题描述】:
我已经在我的应用程序中实现了 UITabBarController。它的代码如下:
MainCollection *mainView = [[MainCollection alloc] initWithNibName:@"MainCollection" bundle:nil];
UINavigationController *mainNav = [[UINavigationController alloc] initWithRootViewController:mainView];
mainView = (MainCollection *)mainNav.topViewController;
mainView.managedObjectContext = self.managedObjectContext;
ShowFavourites *showVC = [[ShowFavourites alloc] initWithNibName:@"ShowFavourites" bundle:nil];
UINavigationController *showNav = [[UINavigationController alloc] initWithRootViewController:showVC];
showNav.title=@"Favourites";
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UITabBarController *tabBar = [[UITabBarController alloc] init];
[tabBar setViewControllers:@[mainNav,showNav]];
[self.window setRootViewController:tabBar];
[self.window makeKeyAndVisible];
return YES;
我的第一个屏幕是 MainCollection 我应该在这个视图中显示 tabBar。假设下一个视图是 SubCategory 但是当我导航到 SubCategory 时,在这个视图上我想隐藏 Tabbar 那么我该如何隐藏它或仅从 SubCategory 视图中删除它?
有什么想法吗?
提前致谢。
【问题讨论】:
-
这是一个令人困惑的问题,请详细描述。
-
@Raj:请检查我编辑的答案
标签: iphone objective-c uitabbarcontroller