I’m using the UINavigationController toolbar. Before I display it, I resize my views so that they don’t get blocked by the toolbar (I set the frame of the current view controller’s view to the rect spanning from the bottom of the navigationBar to the top of the toolbar.
But not all of my view controllers have toolbarItems. So, when switching from a view controller that has items (controller A) to one that doesn’t (controller B), I want to hide the toolbar. However, when I call setToolbarHidden:animated: in B’s viewWillAppear:animated: method, the toolbar animates down during the push transition and shows the UIWindow background behind it.
This also happens in the reverse direction: when transitioning from B to A (via the back button), I want the toolbar to animate in to show A’s toolbarItems again, but since A’s view doesn’t extend to the bottom of the screen, the UIWindow is visible during the pop transition.
That might not have been the best description, so here’s a screenshot:

I have tried updating A’s frame in its viewWillDisappear:animated: method, but it does strange things, since it seems to be called within the UINavigationController push animation block. Any insight would be appreciated.
Update: I tried hiding the toolbar in B’s viewDidAppear:animated: instead, but the results weren’t ideal. Using this solution, the toolbar doesn’t get dismissed until the push transition completes. Since B doesn’t have any toolbarItems, A’s items get pushed to the left during the transition, leaving an empty toolbar on the screen before it disappears. Also, when going back to A, the UIWindow background will be visible unless I set the toolbar to visible in B’s viewWillDisappear:animated:, which would mean that B has to know that A has toolbarItems.
Since I never found a satisfactory solution to this involving animation, I ended up making my views extend down behind the toolbar to avoid showing the window. If your controller’s view is a UITableView or UIScrollView, you can set its
contentInsetappropriately so that your content won’t get covered up by the toolbar: