How to disable the bounce effect (blue tint when scrolling to the end) of web browsing in android?

I found that the webview is similar to the scroll view, which means that when I view the view to the end, there will be a blue tint at the end of the view (if it is> 4.0). So how to disable the behavior of this? How to disable the bounce effect? Thank you

mWebView.setWebViewClient(new MyWebViewClient(getActivity())); chromeCilent = new MyWebChromeClient(getActivity()); mWebView.setWebChromeClient(chromeCilent); mWebView.getSettings().setDomStorageEnabled(true); mWebView.getSettings().setPluginState(WebSettings.PluginState.ON); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setLoadsImagesAutomatically(true); mWebView.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH); mWebView.getSettings().setSupportZoom(false); mWebView.getSettings().setSavePassword(false); mWebView.getSettings().setBlockNetworkImage(false); mWebView.getSettings().setSupportMultipleWindows(false); mWebView.getSettings().setAppCacheEnabled(true); mWebView.addJavascriptInterface(this, "jsinterface"); // default go to video page mWebView.loadUrl(url); 
+6
source share
2 answers

I believe this will work:

 mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); 
+10
source

If you want to disable the effect directly in the layout XML resource, you can use:

 android:overScrollMode="never" 

This is effectively equivalent to Coeffect.

The advantage of this in the XML file, and not in the Java code, is that you do not need to create a view identifier to disable the effect. In Java, you will need an ID to get a view link to turn off the effect, while in xml you can directly use the above attribute without having to create an identifier.

+10
source

All Articles