Ability to disable WebView auto zoom
See original GitHub issueFrom @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:
- Created 6 years ago
- Comments:32 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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">
@tsonevn Here’s my solution https://github.com/mxth/NativeScript/commit/d7ae10566ef42f32571f2e691be6bb90f75d6521