How to delete built-in margins in Android WebView using JavaScript

I use Android WebView in my application. I noticed that it has a built-in edge. So I need to delete it according to the UI requirements

I use it to get perfect results

 @Override
        public void onPageFinished(WebView view, String url) {
//            super.onPageFinished(view, url);
            webView.getSettings().setJavaScriptEnabled(true);
            webView.loadUrl("javascript:document.body.style.margin=\"0%\"; void 0");
            webView.setVisibility(View.VISIBLE);
        }

Invalid Sign

webView.loadDataWithBaseURL(null, "<style>a{color:#3D7B8A; text-decoration:none}</style>"+ getDescription().replace("<p>", "<p style= \"line-height: 150%; text-align: justify;\" >"), "text/html", "utf-8",
                    null);

Please give me some advice

resolvent:

As far as I know, from the above code, you don't fill = 0

I read Google and found this question and answer. You may want to see: remove unwanted white space in WebView Android

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>