This question already has an answer here:
- Disable ScrollView Programmatically? 16 answers
I am a android developer.I also want to use a ScrollView.This ScrollView need to some time disable scrolling and Some time enable scrolling .But i can no able to disable the scrolling .How to i implement it .Please help to me.I also try to use the some code such a s
fullparentscrolling.setHorizontalFadingEdgeEnabled(false);
fullparentscrolling.setVerticalFadingEdgeEnabled(false);
or
fullparentscrolling.setEnabled(false);
But it does not work.
Try this way
Create Your CustomScrollview like this
In your xml
// "com.example.demo" replace with your packagename
In your Activity
You cannot disable the scrolling of a ScrollView. You would need to extend to ScrollView and override the onTouchEvent method to return false when some condition is matched.
You could modify ScrollView as follows to disable scrolling
for furthe reference here is the complete solution on stack overflow too! Disable ScrollView Programmatically?
mark this as answer for others help..thank you
I set the on touch listener for the scroll view and in the onTouch method i returend true. That did the trick for me.
Best for all
Try this, this will disable the scroll function.