I am trying to load a responsive webpage into a UIWebview using the following code in my viewDidLoad UIViewController method:
NSURL *url = [NSURL URLWithString:self.webViewURL];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:request];
Instead of loading the web page so that it looks based on the frame size of the UIWebView, it sets the UIWebView UIScrollView contentSize to some seemingly arbitrary size (larger than the size of my web view) and loads the responsive web page as he will look for this frame size.
If I try to download the URL that I use in Safari, it is ordered correctly according to the size of the browser window.
I tried setting the scalesPageToFit property to YES, although I really do not want to scale the page, but should it respond to the structure of the web view.
Does anyone have any ideas as to what is happening and how can I fix this?
source
share