I have two UIViewController
s within a UINavigationController
. The topmost has hidesBottomBarWhenPushed
set to YES
. When I push the topmost UIViewController
, its UITableView
is pushed about 20px above where it should be (notice the difference in cell height between the top to cells of the pushed view controller).
Compare to in cell position in the screenshot below:
Additionally, when I pop the topmost UIViewController
, its UITableView
is pushed about 20px below where it should be (notice the extra dark blue space above the UITableView
).
I've tried moving my -[UIViewController setHidesBottomBarWhenPushed:YES]
calls into -[UIViewController loadView]
, -[UIViewController viewWillAppear:]
, and -[UIViewController viewDidAppear:]
. Those callbacks are all too late because the UIViewController
has already been pushed, so the UIToolbar
is not hidden.
Is there any way to avoid these gaps? Presently, I'm calling -[UINavigationController setToolbarHidden:YES animated:NO]
in my topmost UIViewController
's -[UIViewController viewDidAppear:]
and -[UINavigationController setToolbarHidden:NO animated:NO]
in my bottommost UIViewController
's -[UIViewController viewDidAppear:]
. This is less than ideal.