Search code examples
react-nativereact-native-scrollview

Prevent pull-to-refresh for ScrollView in react-native


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:

enter image description here


Solution

  • 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.