关键是要调整navBarTransitionView 的frame。
调整此view的frame后,view controller的view的frame会随其自动调整高度。
float newHeight = 49;
self.navigationController.navigationBar.frame = CGRectMake(
self.navigationController.navigationBar.frame.origin.x,
self.navigationController.navigationBar.frame.origin.y,
self.navigationController.navigationBar.frame.size.width,
newHeight
);
UIView* navBarTransitionView = [self.navigationController.view.subviews objectAtIndex:0];
navBarTransitionView.frame = CGRectMake(0,
,navBarTransitionView.frame.origin.y-(newHeight-44)
, 320
, navBarTransitionView.frame.size.height+(newHeight-44)
);