Ability to disable WebView auto zoom

See original GitHub issue

From @jibon57 on February 17, 2018 8:42

Hello,

I am trying to disable to auto zoom of webview by this:

ngAfterViewInit() {
        let webview: WebView = this.webViewRef.nativeElement;

        webview.on(WebView.loadStartedEvent, function (args: LoadEventData) {
            if (webview.android) {
                webview.android.getSettings().setLoadWithOverviewMode(true);
                webview.android.getSettings().setUseWideViewPort(true);
            } else {
                webview.ios.scrollView.minimumZoomScale = 1.0;
                webview.ios.scrollView.maximumZoomScale = 1.0;
                webview.ios.scalesPageToFit = true;
            }
        })
        webview.on(WebView.loadFinishedEvent, function (args: LoadEventData) {
            if (webview.ios) {
                webview.ios.scrollView.minimumZoomScale = 1.0;
                webview.ios.scrollView.maximumZoomScale = 1.0;
                webview.ios.scalesPageToFit = true;
            }
        })
    }

following: https://stackoverflow.com/a/21654472 The above solution is working in Android but not in iOS. How can I solve it? Thanks in advance.

Copied from original issue: NativeScript/ios-runtime#883

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:32 (5 by maintainers)

github_iconTop GitHub Comments

18reactions
Code1912commented, Aug 18, 2018

you can set the html page’s meta, like this: <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable zoom on web-view react-native? - Stack Overflow
I was able to disable zooming, text selection and other pointer events by wrapping WebView in a View and setting a few props:...
Read more >
How to disable zoom in WebView - MSDN - Microsoft
The WebView takes all the space in my page and it's all working perfectly except for one thing: I want to disable zooming...
Read more >
disabling zoom in a webview - Google Groups
Has anyone been able to answer this? I too am struggling with pinch/zoom on Android, I really need to be able to turn...
Read more >
how to disable Zoom-Out & Zoom… | Apple Developer Forums
Hi developers is there any chanse to disable Zoom-Out & Zoom-In in WkWebView? here's all my code so far keep in mind i'm...
Read more >
How to Disable Zoom on a Mobile Web Page With HTML and ...
To disable the zooming option, you can use the Surefox browser, but still, the page will zoom in and out by double-tapping on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found