Note that there are some explanatory texts on larger screens.

plurals
  1. POPut an image inside a webview and fit it width
    primarykey
    data
    text
    <p>I'd like to use a WebView for displaying images potentially big (in order to seize it memory management). For the test i'm loading this code in the WebView</p> <pre><code>&lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;img alt="test" src="file:///android_asset/cute-cat-sleeping.jpg"&gt; &lt;/body&gt; </code></pre> <p>The problem is that if I load it in a web "as is". The WebView only allow to zoom out until the first dimension of the image is fit in screen. In this example the image height is totally shown into the WebView and then no more zoom allowed:</p> <p><img src="https://i.stack.imgur.com/UYU20.png" alt="No zoom no setUseWideViewPort"></p> <p>As you can see this mode doesn't allow a correct display of the global image despite that when the image is zoomed the behaviour in the right and bottom corners are correct as you can see here</p> <p><img src="https://i.stack.imgur.com/zDq0k.png" alt="correct zoom display"></p> <p>So I tried the <strong>(WebView).getSettings().setUseWideViewPort(true)</strong> and the result is that I can zoom out more than the image's width</p> <p><img src="https://i.stack.imgur.com/7MKJT.png" alt="with setUseWideViewPort"></p> <p>and the zoomed behaviour is not correct in the bottom-right borders:</p> <p><img src="https://i.stack.imgur.com/UEt8b.png" alt="zoom with setUseWideViewPort"></p> <p>Summarizing: I'd like the max zoom out possible to be imageWidth=webview width and zoom behaviour like in the second image:</p> <p><img src="https://i.stack.imgur.com/gk50d.png" alt="enter image description here"></p> <p>Complete and/or usefull answers will be bountied</p> <p>EDIT: Bounty opened for Vinayak.B</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload