Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 30th, 2012  |  syntax: None  |  size: 1.55 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to hide a navigation bar from one particular view controller
  2. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
  3.  
  4.  
  5. self.splashScreen = [[SplashScreen alloc]
  6.                 initWithNibName:@"SplashScreen"
  7.                 bundle:nil];
  8. if (self.pageController == nil) {
  9. openingpage *page=[[openingpage alloc]initWithNibName:@"openingpage" bundle:[NSBundle mainBundle]];
  10.     self.pageController = page;
  11.     [page release];
  12. }
  13. [self.navigationController pushViewController:self.pageController animated:YES];
  14.  
  15. [window addSubview:splashScreen.view];
  16.  
  17.  [splashScreen displayScreen];
  18. [self.window makeKeyAndVisible];
  19.  
  20. return YES;
  21.  }
  22.        
  23. [navigationController setNavigationBarHidden:YES];
  24.        
  25. [self.navigationController setNavigationBarHidden:YES];
  26.        
  27. --UINavigationController
  28. ------UIViewController1
  29. ------UIViewController2
  30. ------UIViewController3
  31.        
  32. -(void)viewWillAppear:(BOOL)animated{
  33.     [self.navigationController setNavigationBarHidden:YES];   //it hides  
  34. }
  35.  
  36. -(void)viewWillDisappear:(BOOL)animated{
  37.     [self.navigationController setNavigationBarHidden:NO];    // it shows
  38. }
  39.        
  40. -(void)applicationDidFinishLaunching:(UIApplication *)application {
  41.     [window addSubview:splashView];
  42.     [NSThread detachNewThreadSelector:@selector(getInitialData:)
  43.                                  toTarget:self withObject:nil];
  44. }
  45.  
  46. -(void)getInitialData:(id)obj {
  47.     [NSThread sleepForTimeInterval:3.0]; // simulate waiting for server response
  48.     [splashView removeFromSuperview];
  49.     [window addSubview:tabBarController.view];
  50. }