I know this has been asked many times, but I cannot get it to work. In short, my UIWebview pulls in some HTML that does not have a fixed height (the width is always the same), I just want the height to change accordingly.
I tried a number of fixes that I found on the Internet, but my problem is that the webview will resize to the correct size, but only for a short second, and then return to its original size.
I must point out that my point of view is caused by segue, this is the only thing I can think of, it’s different! I am wondering if the code works, but when segue finishes it with a crossfade, flipping, or having it redraw the webview.
Here is my current code (as I said, I tried many fixes, including Java versions, most of which do the same), I also played with scalesPageToFit and srollEnabled, as well as several ticks in the storyboard.
-(void)webViewDidFinishLoad:(UIWebView *)webView { NSLog(@"Starting Size : %f", headerWebView.frame.size.height); headerWebView.scalesPageToFit = YES; headerWebView.scrollView.scrollEnabled = NO; CGRect frame = headerWebView.frame; frame.size.width = frame.size.width;
Magazines say:
Starting Size: 176,000000 Finish Size: 246.000000
Has anyone got an idea of why Webview seems to be beautiful long enough for me to notice and then “shrink”?
Recycled steel
source share