Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable "flinging" in android ScrollView?

When you have a ScrollView in android, you can scroll really fast by flinging the ScrollView up or down, but I don't want this enabled.

Is there a way to disable the flinging?

like image 403
William L. Avatar asked Dec 12 '25 12:12

William L.


1 Answers

You need to Override the onFling() method. Override the onFling() and just have it return false.

Here is an EXAMPLE that might help you with creating a GestureDetector and overriding the onFling().


For your onFling() method you will want this:

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
{
    return false;
}
like image 115
prolink007 Avatar answered Dec 14 '25 03:12

prolink007



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!