2

In my application i want to hide the navigation bar when i m going to previous view and i m hiding navigation bar in viewwiilldisaapper method but the effect is remaining mean it gives the white screen at the time of pop..

so can any one tell me the solution for it.

Thanks to all.

Priyanka
  • 511
  • 8
  • 24

3 Answers3

7

you need to hide navigation bar on viewWillAppear of that page by using

- (void) viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void) viewWillDisappear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

if you need to hide navigation bar in certain condition then you need to put proper if else statements, so use this info with your logic according to your condition.

And view is automatic adjusted so no white space you get after pop but you get at time of pop.(no solution for this).

Costique
  • 23,712
  • 4
  • 76
  • 79
Ishu
  • 12,797
  • 5
  • 35
  • 51
1
  • (void) viewWillDisappear:(BOOL)animated {

    if (self.navigationController.topViewController != self)

    {

    [self.navigationController setNavigationBarHidden:NO animated:animated];
    

    }

    [super viewWillDisappear:animated]; }

Tariq
  • 9,861
  • 12
  • 62
  • 103
-1

I think it happen due to customize navigation bar. Is this right? If you have customize navigation bar then you need to resize your upcoming view. It doesn't matter how would you hide it.

sudesh
  • 144
  • 2