In my app webview, there's no problem to fit text html to screen on first load but the problem occurs when you try to load a page that contains a single large image as the first page after you start an activity.
If you try to load a page with single large image after you load any type of page after the activity started, the page with single large image will fit to the screen with no problem. But, if you try to load the page with single large image as the first page after the activity started, it will display a page with small image with lots of white space around it.
Is there any way to fit the page with single large image with one WebView#loadUrl method?
This is my html page with single large image source
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cover Title</title>
</head>
<body>
<div id="cover">
<svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 1125 1600" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
<image height="1600" width="1125" xlink:href="../images/v01-cover.jpg" />
</svg>
</div>
</body>
</html>
I already tried setting the setLoadWithOverviewMode(true) and setUseWideViewPort(true) but didn't work out for me.
Read supermus comment in this link Android WebView, Scaling Image to fit the screen