I have spent the last couple hours trying to find a way to get the WebView to scale the page to the screen like it does in the browser but I'm not having any luck. The resolution of the device is not the width available for you to use. You can do this all on the desktop by simply opening and closing the width of the browsers and checking your design. It should be noted, that the default value of WebView. I see is a setting called setLoadWithOverviewMode, but that didn't appear to do anything at all. I think you can only do that if you are building an App which is beyond my area of expertise and more a question for the mobile forum than the css forum although the mobile forum is pretty quiet.
The following code loads the desktop version of the Google homepage fully zoomed out to fit within the webview for me in Android on an.
Video: Webview zoom fit android How to fix horizontal scrolling in Android WebView with viewpager?
› questions › android-webview-webpage-should. Although documentation says that 0 will zoom all the way out if setUseWideViewPort These work for me and fit the WebView to screen width.
These are old articlea but explains the original concept. New replies are no longer allowed. Has anyone found a way to accomplish this? If you have chrome them call up the devtools and click the mobile icon at the top and then you can select various phones from a dropdown and see the real size that they render at.
viewport set webview zoom to fit the application .. Android Development Android Forums
Upvotes on questions will now be worth the same as upvotes on answers. Thanks for the help Paul!
WebView supports DOM, CSS, and meta tag features to help you ensure that web the size of the screen when zoomed all the way out, the viewport has its own web page layout is flexible and the content will fit the width of small screens.
If it would be a website or app then sure i would not make it fixed and disable zoom.
It puts a lot of whitespace around some images on older phones, but works on my newer one.
Of course you may have a valid use for the techniques you are using as I am only going from that little snippet but it is wise to be careful. I'm working with loading images for this answer and I want them to be scaled to the device's width.
Thanks Brian, that appears to be working at first glance. You can see the drawing in the screenshot.