Reputation: 41
I set WebView with this initial values
webview.getSettings().setBuiltInZoomControls(true);
webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
After the first loading, the web page shows as full page. If I load a new Url the new page shows with the last zoom settings. It is not loaded with the initial setting. How can I reset the last zoom settings to initial value before loading the next url?
Upvotes: 4
Views: 2974
Reputation: 9061
In my app, testing on Android 8, I tried all the combinations of the previous answers. setInitialScale
made no difference and only this reset the zoom level before a new load:
webView.getSettings().setLoadWithOverviewMode(false);
webView.getSettings().setLoadWithOverviewMode(true);
Upvotes: 0
Reputation: 3971
In Kotlin you wan try :
webview.settings.loadWithOverviewMode = true
webview.setInitialScale(0)
Upvotes: 0
Reputation: 2367
try to set these properties- webview.getSettings().setLoadWithOverviewMode(true); webview.setInitialScale(0);
Upvotes: 5