I’ve created a two splash screen iPhone app. Afterwards user is taken to first view. I’ve added a UINavigationController. It works perfectly fine.
How do I remove the navigation bar for the opening view alone?
MainWindow
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.splashScreen = [[SplashScreen alloc]
initWithNibName:@"SplashScreen"
bundle:nil];
if (self.pageController == nil) {
openingpage *page=[[openingpage alloc]initWithNibName:@"openingpage" bundle:[NSBundle mainBundle]];
self.pageController = page;
[page release];
}
[self.navigationController pushViewController:self.pageController animated:YES];
[window addSubview:splashScreen.view];
[splashScreen displayScreen];
[self.window makeKeyAndVisible];
return YES;
}
Try this method inside a view controller:
More clarifications:
UINavigationControllerhas a property navigationBarHidden, that allows you to hide/show the navigation bar for the whole nav controller.Let’s look at the next hierarchy:
Each of three UIViewController has the same nav bar since they are in the UINavigationController. For example, you want to hide the bar for the UIViewController2 (actually it doesn’t matter in which one), then write in your UIViewController2: