I did this exact same thing with a XIB and it works, but something is wrong with my storyboard version.
Here's my UIWebView Delegate code
#pragma mark - UIWebViewDelegate Protocol Methods
- (void)webViewDidFinishLoad:(UIWebView *)webView {
CGRect frame = webView.frame;
frame.size.height = webView.scrollView.contentSize.height;
_webView.frame = frame;
NSLog(@"Webview Frame height is %f", _webView.frame.size.height);
_scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width, _headerImageView.frame.size.height + webView.frame.size.height);
NSLog(@"scrollview content height is %f", _scrollView.contentSize.height);
}
NSLog is showing proper webview frame height of about 800 points. Scrollview content size is perfect about 1000 points.
My Scrollview is set to have a red background. So you can see here the webview frame is only about 500 points on screen and the rest of the content is getting cut off.
Any ideas? Thanks!