简体   繁体   中英

Android WebView content scaling

I have same applications on two devices with different screen sizes, one is 1024x600(180dpi), another is 1280x800(213dpi). This app contains webview with dimensions specified in pixels. On first device it is a little smaller. The problem is that when I load my custom html page, on first device with smaller screen and webview the page is rendered correct, but on second device with bigger screen and bigger webview, it doesn't fit. I expected page to fit the second webview following white spaces, because page is fixed size and second device screen is bigger. How to fix this?

Html had this line:

<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0" />

It was the reason why setInitialScale() didn't work at first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM