I know that there is a way to support zoom in java: webview.getSettings().setSupportZoom(true)
. But I've been searching for a while for this in Kotlin. And yes, I have tried using the converter try.kotlinlang.org but It gives me the same piece of code. Does somebody know how to support zoom in Kotlin?
Why not simply:
var webView: WebView = view.findViewById(R.id.webview)
webView.settings.setSupportZoom(true)
Update
As per your comments you would want to do this as well:
webView.settings.builtInZoomControls = true // enable pinch to zoom and zoom controls
webView.settings.displayZoomControls = false // hides the zoom controls so you can just pinch to zoom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With