title: How to resize view when using UINavigationController setToolbarHidden:animated:
body: <p>I'm using the <code>UINavigationController</code> 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 <code>navigationBar</code> to the top of the <code>toolbar</code>.</p>
  
  <p>But not all of my view controllers have <code>toolbarItems</code>. 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 <code>setToolbarHidden:animated:</code> in B's <code>viewWillAppear:animated:</code> method, the toolbar animates down during the push transition and shows the <code>UIWindow</code> background behind it.</p>
  
  <p>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 <code>toolbarItems</code> again, but since A's view doesn't extend to the bottom of the screen, the <code>UIWindow</code> is visible during the pop transition.</p>
  
  <p>That might not have been the best description, so here's a screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/ht3JU.jpg" alt="Cmd-shift-3 rapid-fire FTW"></p>
  
  <p>I have tried updating A's frame in its <code>viewWillDisappear:animated:</code> method, but it does strange things, since it seems to be called within the <code>UINavigationController</code> push animation block. Any insight would be appreciated.</p>
  
  <p><strong>Update</strong>: I tried hiding the toolbar in B's <code>viewDidAppear:animated:</code> 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 <code>toolbarItems</code>, 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 <code>UIWindow</code> background will be visible unless I set the toolbar to visible in B's <code>viewWillDisappear:animated:</code>, which would mean that B has to know that A has <code>toolbarItems</code>.</p>