title: UIWebView ContentSize Height
body: <p>I have a <code>UIImage</code>, a <code>UILabel</code> and a <code>UIWebView</code> inside a <code>UIScrollView</code>. Basically, I'm calculating the height of both the <code>UIImage</code> and the <code>UILabel</code> and adding it to the <code>UIWebView</code> height to set the UIScrollView's contentSize.</p>
  
  <p>Here's how I calculate the UIWebView height:</p>
  
  <pre><code>- (void) webViewDidFinishLoad:(UIWebView *)webView {
      CGRect frame = webView.frame;
      CGSize fittingSize = [webView sizeThatFits:webView.scrollView.contentSize];
      frame.size = fittingSize;
      webView.frame = frame;
  
      self.scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, frame.size.height + y + 10);
  
      [webView setFrame:CGRectMake(x-8, y, webView.frame.size.width, frame.size.height)];
      [webView setContentMode:UIViewContentModeScaleAspectFit];
  }
  </code></pre>
  
  <p>The problem is for some cases the <code>UIWebView</code> is cut on the bottom... Any ideia why?</p>
  
  <p>This might be relevant: the <code>UIWebView</code> content is HTML code I have no control on.</p>