Webview reflows text by default, so to not reflow it, set algorithm to
webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
as in How to stop android webview content reflow when double tapped?
سؤال
I am having trouble with webview wrapping my html incorrectly.
WebView webView = new WebView(getActivity());
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setUseWideViewPort(true);
settings.setLoadWithOverviewMode(true);
webView.loadUrl(getArguments().getString(URL));
Ive set a border around body to see it, but webview leaves weird margin on the right, as if the text was scaled first and then the border was drawn, i dont know .. The stock browser however wraps it just fine
I am not a web developer som please bear with me. I just presume its a webview issue as the stock browser renders it just fine.
Thanks!
المحلول
Webview reflows text by default, so to not reflow it, set algorithm to
webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NORMAL);
as in How to stop android webview content reflow when double tapped?