title: UIView doesn't resize to full screen when hiding the nav bar & tab bar
body: <p>I have an app that has a tab bar &amp; nav bar for normal interaction.  One of my screens is a large portion of text, so I allow the user to tap to go full screen (sort of like Photos.app).</p>
  <p>The nav bar &amp; tab bar are hidden, and I set the the text view's frame to be full screen.  The problem is, there is about 50px of white space where the tab bar used to be.  You can see if from this screen shot:</p>
  <p><em>removed dead ImageShack link</em></p>
  <p>I'm not sure what's causing this.  The whitespace is definitely not the view behind the text view, as I set it's background color to red just to be sure.  What could be causing this?</p>
  <p>** UPDATE **</p>
  <p>I did some hit testing in a UIWindow subclass and found out that the whitespace is actually the undocumented/unpublished UILayoutContainerView.  This is the parent view of the tabBar.  I don't think it's recommended to directly manipulate this view, so how can I hide the tab bar?</p>
  <p>** UPDATE # 2 **</p>
  <p>I checked self.view's frame before &amp; after animation, and it looks like the parent view is not resizing enough.</p>
  <p>after going fullscreen, the view's frame is only 411 pixels tall.  I've tried messing with the frame manually and also setting autoResizeMask with no luck.</p>
  <p>**** UPDATE:  Here's the end result ****</p>
  <pre><code>- (void)toggleFullscreen {
      isFullScreen = !isFullScreen;  //ivar
      
      //hide status bar &amp; navigation bar
      [[UIApplication sharedApplication] setStatusBarHidden:isFullScreen animated:YES];
      [self.navigationController setNavigationBarHidden:isFullScreen animated:YES];
      
      [UIView beginAnimations:@&quot;fullscreen&quot; context:nil];
      [UIView setAnimationBeginsFromCurrentState:YES];
      [UIView setAnimationDuration:.3];
      
      //move tab bar up/down
      CGRect tabBarFrame = self.tabBarController.tabBar.frame;
      int tabBarHeight = tabBarFrame.size.height;
      int offset = isFullScreen ? tabBarHeight : -1 * tabBarHeight;
      int tabBarY = tabBarFrame.origin.y + offset;
      tabBarFrame.origin.y = tabBarY;
      self.tabBarController.tabBar.frame = tabBarFrame;
      
      //fade it in/out
      self.tabBarController.tabBar.alpha = isFullScreen ? 0 : 1;
      
      //resize webview to be full screen / normal
      [webView removeFromSuperview];
      if(isFullScreen) {
                  //previousTabBarView is an ivar to hang on to the original view...
          previousTabBarView = self.tabBarController.view;
          [self.tabBarController.view addSubview:webView];
  
          webView.frame = [self getOrientationRect];  //checks orientation to provide the correct rect
          
      } else {
          [self.view addSubview:webView];
          self.tabBarController.view = previousTabBarView;
      }
      
      [UIView commitAnimations];
  }
  </code></pre>
  <p>(note that I switched textview to webview, but the same works for the original text view)</p>