Reputation: 4595
Is there a way to zoom out or reset a UiWebView programmatically ? if yes how ?
Upvotes: 3
Views: 4366
Reputation: 33335
i think you should be able to manipulate the viewport using the safari meta tags
For example, to set the viewport width to the width of the device, add this to your HTML file:
<meta name = "viewport" content = "width = device-width">
To set the initial scale to 1.0, add this to your HTML file:
<meta name = "viewport" content = "initial-scale = 1.0">
To set the initial scale and to turn off user scaling, add this to your HTML file:
<meta name = "viewport" content = "initial-scale = 2.3, user-scalable = no">
Upvotes: 3
Reputation: 13791
If you want to reset the user scale to 1.0, at least on iOS 4.2 you can toggle scalesPageToFit
:
webView.scalesPageToFit = NO;
webView.scalesPageToFit = YES;
Upvotes: -1