简体   繁体   中英

Set Height Parameters for Android Webview

I try to make specific web pages fit my android webview. Some read the screen size by using javascript's screen object (screen.width). The webview delivers the devices Display Properties which i would rather set myself.

I am also searching for a way to modify the window.innerHeight and width. Is there any way?

Try this

    WebView browser = (WebView) findViewById(R.id.webview);
    browser.getSettings().setLoadWithOverviewMode(true);
    browser.getSettings().setUseWideViewPort(true);

this fixes size based on screen size

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