Search code examples
react-nativereact-native-flatlist

Flatlist is not scrollable


I am trying to create a scrollable grid in my app but I am unable to scroll it . Tried everything but nothing is working .

return (
    <FlatList
      data={data}
      renderItem={({item}) => (
        <GridImage style={styles.imageThumbnail} imageUri={item} numColumns={3} />
      )}
    />
  );
};

Solution

  • Wrap flatlist in a view and give height & width to it.

    return (
        <View style={{ height:600,width:600 }}>
            <FlatList
                data={this.state.data}
                renderItem={({item}) => <Country name={item} />}
            />
        </View>
    );