title: Having a problem making UIWebView autoresize to users orientation
body: <p>I have UIWebView that automatically resizes to the users orientation when they rotate the device with the following code:</p>
  
  <pre><code>- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
  [self.webView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; 
  </code></pre>
  
  <p>the code works fine if the user rotates while looking at the webView, the problem occurs if the user rotates the device in a different view(previous screen) and then navigates to my webView (screen), my webview becomes cut off. Im not sure how to automatically rotate it based on detected orientation. I tried putting the following code into my viewDidLoad but it doesnt seem to work</p>
  
  <pre><code>[self.webView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; 
  </code></pre>
  
  <p>any suggestions would be greatly appreciated.</p>