Ok, here\'s the scenario: I\'m building an iPad app that will display an UIWebView, width = 320 pixels (or points now). It will wind of a \"widget\" inside the app.
This seems to be a better solution because it doesn't require reloading the HTML: https://stackoverflow.com/a/6104537/1449618
The following works in my app on iPad.
Set self as UIWebViewDelegate then:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.querySelector('meta[name=viewport]').setAttribute('content', 'width=%d;', false); ", (int)webView.frame.size.width]];
}