Android WebView zoom controls do not move after resizing

I use Webview to display images with scaling and scrolling. WebView is set to wrap_content for height and width, and zoomcontrols are enabled.

If the image is smaller, then the web view will only show the image on the screen, and a lot of free space will remain on the screen. The moment the user zooms out, the WebView will grow in accordance with the new resolution. The problem is that the zoomcontrols stay in one place and stop working after the web page is resized. If I let them disappear and touch the show again, they will appear on the new day of the presentation and will work again.

This seems like a webview bug. Is there a way to capture the resize of the web view and then disable and enable the zoom features?

+3
source share
1 answer

If you try webview.getSettings().setBuiltInZoomControls(false);

The zoom control will not be displayed at the bottom of the screen.

And on an Android device, it will increase and decrease your web browsing.

And for white space in scrray for small images you should try

view.getSettings().setLoadWithOverviewMode(true);

view.getSettings().setUseWideViewPort(true);
0
source

Source: https://habr.com/ru/post/1744316/


All Articles