Is it possible to do all of the above? SO has given me a great way to set the initial zoom scale here. Namely, to include the following line in my webViewDidFinishLoad met
The difference with my answer is you are clearing the viewport before setting the width.
This allows for the web view to be rotated or resized (after being loaded) without resetting your attribute changes.
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
// Clear view port
NSString* js = @"$('meta[name=viewport]').remove();";
[webView stringByEvaluatingJavaScriptFromString: js];
// Set content size
js = [NSString stringWithFormat:@"var meta = document.createElement('meta');"
"meta.setAttribute( 'name', 'viewport' ); "
"meta.setAttribute( 'content', 'width = device-width, initial-scale = 5.0, user-scalable = yes' ); "
"document.getElementsByTagName('head')[0].appendChild(meta);"];
[webView stringByEvaluatingJavaScriptFromString: js];
}