Reputation: 37
Is there a way to prevent pull-to-refresh functionality for ScrollView component? I want to be able scroll, but I don't wanna allow to pull down content of component and prevent situations like this:
Upvotes: 0
Views: 4587
Reputation: 833
You seem like you have placed the View containing you custom made action bar inside the scroll view, and what's happening in the image you provided isn't caused by pull-to-refresh it's provided by overscrolling so you got 2 solutions:
1-Place your action bar outside your ScrollView and make the action bar and the ScrollView childrens of 1 View.
2-Add alwaysBounceVertical={false} to your ScrollView props.
Hope this helps.
Upvotes: 3
Reputation: 31
use a const refreshing = false , initially. Then on call of _onRefresh , change refreshing from false to true, and reinitialise the content of the scollview.
Upvotes: 0