I have 10 fragments. All Fragments has different different layouts. One of the fragment has a WebView. This Webview is displaying html with javascript enable data. All is working fine in webview such as content loading. But webview is not scrolling horizontally. When i am trying to scroll, it swipe to next fragment page. Below is my code:
WebView w = (WebView) rootView.findViewById(R.id.webview1);
w.getSettings().setLoadWithOverviewMode(false);
w.getSettings().setUseWideViewPort(true);
w.setInitialScale(120);
w.setWebViewClient(new WebViewClient() {
@SuppressWarnings("deprecation")
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@TargetApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
view.loadUrl(request.getUrl().toString());
return true;
}
});
w.getSettings().setLoadsImagesAutomatically(true);
w.getSettings().setJavaScriptEnabled(true);
w.getSettings().setDomStorageEnabled(true);
w.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
w.loadUrl("my url");
My apologies this question already asked but i did not get solution. I have tried below answers.