Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable To show the navigation bar when I do popViewControllerAnimated

I am having two viewControllers , I am navigating from the FirstView to SecondView , by

pushing the SecondView to the navigation controller. Since I don't want the navigation bar

to be shown in the SecondView , I do the following

self.navigationController.navigationBar.hidden=YES;

Then I move back from the, secondView to the FirstView as follows

[self.navigationController popViewControllerAnimated:YES];

But now the navigation Bar is not shown in the FirstView as well since I am hiding it in the

SecondView. I am trying to the following in the FirstView

-(void)viewWillAppear:(BOOL)animated
{

       [super viewWillAppear:YES];

       self.navigationController.navigationBar.hidden=NO;
}
like image 460
Raj Avatar asked Dec 07 '12 10:12

Raj


2 Answers

Try this instead:

- (void) viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:NO];
    [super viewWillAppear:animated];
}
like image 158
Mattias Farnemyhr Avatar answered Sep 30 '22 15:09

Mattias Farnemyhr


You set initWithNib or viewDidLoad method and run it

-(void)viewDidLoad
 {
      self.navigationController.navigationBar.hidden=NO;
 }
like image 23
iPC Avatar answered Sep 30 '22 17:09

iPC