Search code examples
reactjsreact-nativereact-native-flatlist

How do I get Flatlist to scroll item to 1


I wanted a full screen list of videos, but I scroll up and down extremely fast.I wish he only had item +1 or -1 at a time, not so many item slides. Do you have any good ideas? Flatlist doesn't seem to have this property.You can't limit the number of slides enter image description here


Solution

  • I recently had the same problem as you, which I want FlatList to scroll one index in one scroll.

    First I look at the FlatList props, it seems there are no props that can solve my problem. Then I look up with the ScrollView props, because FlatList inherits ScrollView props.

    I found a disableintervalmomentum props which can simply resolve my problem. See more describe at here.

    So you can just add the props and set it to true like below:

     <FlatList
      // other props
      disableintervalmomentum:{true}
     />