Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UiWebView reset zoom programmatically

Is there a way to zoom out or reset a UiWebView programmatically ? if yes how ?

like image 622
thndrkiss Avatar asked May 16 '26 23:05

thndrkiss


1 Answers

i think you should be able to manipulate the viewport using the safari meta tags

https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193-SW6

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">
like image 198
Aaron Saunders Avatar answered May 19 '26 13:05

Aaron Saunders