title: Animating UInavigationBar offscreen leaves black rectangle
body: <p>I want to the UINavigationBar onto screen when a modal UIView appears, as it does in Reeder.</p>
  
  <p>I'm using the excellent SVWebViewController (https://github.com/samvermette/SVWebViewController) to handle creating a web browser from a shouldStartLoadWithRequest</p>
  
  <p>The animation code is from <a href="http://www.theappcodeblog.com/2011/06/02/iphone-app-animation-tutorial-animate-a-uiview-frame/" rel="nofollow">http://www.theappcodeblog.com/2011/06/02/iphone-app-animation-tutorial-animate-a-uiview-frame/</a></p>
  
  <p>Everything works as in the navigationbar is placed off screen but the space left behind (that I want to animate it into it) is BLACK. The rest of the view/webview is WHITE.</p>
  
  <p>How can I make the space allocated to navbar white, ie the background of the view white?
  There is no xib.</p>
  
  <p>I can't find any mention of the navbar in SVWebViewController (only adding a toolbar)</p>
  
  <pre><code>- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
      NSLog(@"They clicked: %@", request);
  
      NSURL *requestURL = [request URL];
  
      if ([[requestURL scheme ] isEqualToString: @"http"] || [[requestURL scheme] isEqualToString: @"https"]) {
  
  
              NSLog(@"Web link %@",requestURL);
  
              SVModalWebViewController *webViewController = [[SVModalWebViewController alloc] initWithURL:requestURL];
              webViewController.modalPresentationStyle = UIModalPresentationFullScreen;
              webViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  
              webViewController.availableActions = SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsCopyLink | SVWebViewControllerAvailableActionsMailLink;
  
              // ios5
  
              if ([[UINavigationBar class]respondsToSelector:@selector(appearance)]) {
  
                  // Create image for navigation background - portrait
                  UIImage *NavigationPortraitBackground = [[UIImage imageNamed:@"navbar_bg_portrait~iPad"]
                                                           resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
  
                  // Create image for navigation background - landscape
                  UIImage *NavigationLandscapeBackground = [[UIImage imageNamed:@"navbar_bg_portrait~iPad"]
                                                            resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
  
                  // Set the background image all UINavigationBars
                  [[UINavigationBar appearance] setBackgroundImage:NavigationPortraitBackground forBarMetrics:UIBarMetricsDefault];
                  [[UINavigationBar appearance] setBackgroundImage:NavigationLandscapeBackground forBarMetrics:UIBarMetricsLandscapePhone];
  
                  [[UINavigationBar appearance] setBackgroundColor:[UIColor whiteColor]];
  
                  // The tintcolor affects the button colour
                  UIColor* col = OPAQUE_HEXCOLOR(0xdb536a);
                  [[UIBarButtonItem appearance] setTintColor:col];
  
              } else {
  
                  // Style the Nav Bar ios4
                  [webViewController.navigationBar applyCustomTintColor];
  
              }
              [self presentModalViewController:webViewController animated:YES];
  
  
              // -&gt; This code hides the UINavigationBar before animation
  
              CGRect navBarFrame = webViewController.navigationBar.frame;
  
              navBarFrame.origin.y = -navBarFrame.size.height;
  
              // set the position of the bar
              webViewController.navigationBar.frame = navBarFrame;
  
              // &lt;- end Hide code
  
  
              return NO;
  
          }
  
      return YES;
  }
  </code></pre>
  
  <p>TIA</p>