Why are there different animations with setNavigationBarHidden?
In my viewDidAppear method I call
[self.navigationController setNavigationBarHidden:YES animated:YES];
and the navigation bar is hidden by sliding it to the left. However, if I detect a tap gesture then do the following
if([self.navigationController isNavigationBarHidden]){
[self.navigationController setNavigationBarHidden:NO animated:YES];
} else {
[self.navigationController setNavigationBarHidden:YES animated开发者_StackOverflow社区:YES];
}
the navigation bar is shown/hidden by sliding it up/down from the top of the screen. Am I doing something to cause the different types of animation or is this the expected behavior?
It seems that it depends on the state of the VC.
If a VC shows or hides the navigation bar in ViewWillAppear, the navcon animates the (dis)appearance of the bar in coincide with the appearance of the new VC.
Also see comments in: changing the direction that the hide animation moves a navigationBar
精彩评论