Not sure if you already solved this, but I ran into the same problem, but with one difference. The navigation stack only gets confused if I set it to No.
So this works:
[self.navigationController setNavigationBarHidden:YES animated:YES]; ... [self.navigationController setNavigationBarHidden:NO animated:YES];
but this is not so:
[self.navigationController setNavigationBarHidden:YES animated:NO]; ... [self.navigationController setNavigationBarHidden:NO animated:NO];
If you really want the animated one to be NO for any reason, one job is to set the alpha value to 0/1 instead of hiding / opening the navigation bar:
- (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.navigationController.navigationBar.alpha = 0.0f; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [self.navigationController.navigationBar setAlpha:1.0f]; }
The disadvantage is that there is no nice animation of the transition to the slide. If you find a better way, let us know.
UPDATE This is already old, but I solved my problem by not guaranteeing that any state in the current viewWillDisappear would be restored to viewWillAppear. Do not pluck things in the view. See what you cannot configure again.
This is what happens when you cancel the pop animation:
- Current ViewWillDisappear
- New viewWillAppear
- [canceled ... cancels]
- New viewWillDisappear
- New viewDidDisappear
- Current ViewWillAppear
- Current viewDidAppear
I think that in this bold new world, viewWillDisappear / viewWillAppear does not always mean that "will disappear / appear" :)
Tree Hugger Feb 08 '14 at 22:40 2014-02-08 22:40
source share