You cannot change the self.view
frame. I do not use setNavigationBarHidden:
to hide the navigation bar, but directly change the frame self.navigationController.navigationBar. This way self.view.frame
will not change.
CGRect frame = (navBarhidden) ? CGRectMake(0, -24,self.view.bounds.size.width,44) : CGRectMake(0, 20,self.view.bounds.size.width,44); self.navigationController.navigationBar.frame = frame;
source share