Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How disable horizontal scrolling in FlatList component

Tags:

react-native

I have the following FlatList Component in my app but even when I set horizontal prop to false it still let me move the screen horizontally when I'm scrolling.

 <FlatList
    data={props.data}
    renderItem={({ item }) => props.renderItem(item)}
    horizontal={false}
    contentContainerStyle={{
      flex: 1,
      justifyContent: "center",
      alignItems: "center",
    }}
  />
like image 1000
Steven Daniel Anderson Avatar asked Jan 26 '23 18:01

Steven Daniel Anderson


1 Answers

As of my understanding, you want to show a list of items horizontally but it should not scroll the list.

If it is the case then in flatlist use: horizontal={true} scrollEnabled={false}

like image 97
NIYAZ Avatar answered Jan 29 '23 21:01

NIYAZ