Issue
I have this webviewer:
<WebView
android:id="@+id/webView2"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
I´m using this code to force the webviewer to load the urls inside itself instead of loading them in the samsung internet explorer:
inner class MyClient : WebViewClient() {
override fun shouldOverrideUrlLoading(view: WebView?, request:
WebResourceRequest?): Boolean {
view?.loadUrl(request?.url?.toString())
return true
}
}
And these are the settings:
webView2.apply {
settings.javaScriptEnabled = true
settings.setSupportZoom(true)
settings.loadWithOverviewMode = true
settings.useWideViewPort = true
webViewClient = MyClient()
}
However I can´t zoom in nor out the websites loaded inside my webviewer, any idea whats the problem?
Thank you in advance for your support
Regards
Solution
Please enable builtin zoom control:
settings.setBuiltInZoomControls(true);
If you want to disable zoom control on the screen, use this:
settings.setDisplayZoomControls(false);
Answered By - Cao Minh Vu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.