简体   繁体   中英

Webpage is not loading correctly on In-App browser Android

I am working on a project which requires opening another Web app in app browser. For that, I used WebView inside Activity and simply loads the Web App URL into it. But it is not rendering the page as it renders in Chrome browser. I have searched for that and updated some WebView setting in Activity but still no luck. Following are the settings: webView.getSettings().setJavaScriptEnabled(true);

    // Other webview options
    webView.getSettings().setLoadWithOverviewMode(true);
    webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
    webView.setScrollbarFadingEnabled(false);
    webView.getSettings().setPluginState(WebSettings.PluginState.ON);
    webView.getSettings().setAllowFileAccess(true);
  webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setAppCacheEnabled(true);

Do I need to add more settings apart from that? Any leads will be appreciable.

Try using viewport properties .

You can enable wide viewport mode with setUseWideViewPort() .

You can define properties of the viewport for your web page, such as the width and initial zoom level, using the <meta name="viewport" ...> tag in your document <head> .

Check this tutorial for additional insights.

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