Share an issue on my project.

Case:

  1. Use native navigationbar
  2. Use native popgesture
  3. Some page have navigation bar, and some not

Problem

When use pop gesture from a “bar page” to a “no bar page”, The animation is weird.

Solution

1
2
3
4
5
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:_navigationBarHidden animated:animated];
}

Remarks

Also, animated:YES can work too, but some times, we don’t want page floating at all times when switch a “bar page” to a “no bar page”.