I found the webview is similar to scroll view , that means when I scroll the view to the end, there will be a blue shade 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? Thanks.
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);
If you subclass Webview, you can simply override onTouchEvent to filter out the move-events that trigger scrolling. public class SubWebView extends WebView { @Override public boolean onTouchEvent (MotionEvent ev) { if(ev. getAction() == MotionEvent. ACTION_MOVE) { postInvalidate(); return true; } return super.
How do I stop list view scrolling in flutter? Flutter ListView – Never Scrollable You can make the ListView widget never scrollable by setting physics property to NeverScrollableScrollPhysics().
What is bouncing scroll physics flutter? BouncingScrollPhysics class Null safety. Scroll physics for environments that allow the scroll offset to go beyond the bounds of the content, but then bounce the content back to the edge of those bounds. This is the behavior typically seen on iOS.
I believe this will work:
mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER);
If you want to disable the effect directly in the layout XML resource, you may use:
android:overScrollMode="never"
This is effectively equivalent to Coeffect's solution.
A benefit of doing this in the xml file rather than in Java code is that you do not need to create an ID of the view to disable the effect. In Java you would need the ID to get reference to the view to disable the effect, while in xml you can directly use the above attribute without having to create the ID.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With