Visual error in Webview

Asked

Viewed 31 times

0

I’m using a webview to expose my site, but on the sides it has two white bars as in the photo.

inserir a descrição da imagem aqui

Code:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_principal);
    WebView webView = (WebView) findViewById(R.id.web);
    webView.loadUrl("https://www.meudominio.com/");

    WebSettings ws = webView.getSettings();
    ws.setAllowFileAccess(true);
    ws.setCacheMode(WebSettings.LOAD_DEFAULT);
    ws.setJavaScriptEnabled(true);
    ws.setAppCacheMaxSize(5 * 1024 * 1024); //5mb
    ws.setSupportZoom(false);
    ws.setAppCacheEnabled(true);

    ws.setLoadsImagesAutomatically(true);
    ws.setAppCacheEnabled(true);
    ws.setDatabaseEnabled(true);
    ws.setDomStorageEnabled(true);
    ws.setJavaScriptCanOpenWindowsAutomatically(true);


}

1 answer

1

I managed to solve personal, just add as true the wideviewport:

 WebSettings ws = webView.getSettings();
        ws.setUseWideViewPort(true);`

Browser other questions tagged

You are not signed in. Login or sign up in order to post.