I am using android webview in my application.I noticed that it has the inbuilt margin.So need to remove it as per UI requirement.
I have used this it's getting the perfect result.
@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);
}
it's getting refreshed when it's notified and it's looks as too bad.
But we can apply the JavaScript to our html code as well right?
I have used <script> <script/>
over there but no result.
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 advise.