roostertech

coding and day dreaming

Monthly Archives: February 2016

Android Webview viewport scaling

I have a dialog which contain a Webview which display some HTML. Because the webview is in a layout with padding, the content of the html was being cut off at the side.

Typical use case of viewport meta would set width=device-width. But in my case since the Webview does not cover the whole screen this does not work.

So what I ended up doing was to use relative content width and scale the page back to fit.