title: How to update web view width after device rotation in objective c?
body: <p>When I first load the web view its frame is correct but when I rotate the device, its width is not update.<br/>
  For instance, if the view was portrait and I rotate it in landscape the web view frame is not cover the whole view.</p>
  
  <p><strong>Loading web view</strong></p>
  
  <pre><code>-(void) viewWillAppear:(BOOL)animated {
      [super viewWillAppear:animated];
  
      [self loadWebView];
  }
  
  -(void) loadWebView {
      UIWebView *webView;
  
      webView = [[UIWebView alloc] initWithFrame: self.view.frame];
  
      NSString *htmlString = [NSString stringWithFormat:@"%@%@%@",html_header_with_files,DetailsHtml,HTML_FOOTER];
  
      [webView loadHTMLString:htmlString baseURL:nil];
      [self.view addSubview:webView];
  }
  </code></pre>
  
  <hr>
  
  <p><strong>First try:</strong>
  I added a notification to realize the rotation</p>
  
  <pre><code>- (void) orientationChanged:(NSNotification *)note
  {
      [self.view layoutIfNeeded];
  }
  </code></pre>
  
  <p>Above code did not solve the problem.<br/></p>
  
  <hr>
  
  <p><strong>Second try</strong></p>
  
  <pre><code>- (void) orientationChanged:(NSNotification *)note
  {
      [self loadWebView];
  }
  </code></pre>
  
  <p>Above code did not solve the problem.<br/></p>