Skip to content

FlatList not scrolling

i have created a screen where I display a component that contains a FlatList. For some reason I can’t scroll through the list. Someone who can spot my mistake and point me in the right direction?

render-function and style from my screen file:

JavaScript

render function and style from my listitem component:

JavaScript

render function and style from my list component:

JavaScript

my data items have all a unique id, title, date, hour.

Read through all available guides and docs and found no solution.

Advertisement

Answer

Take out the flex: 1 in your styles.cardcontainer, that should let you scroll. The FlatList/ScrollView contentContainerStyle prop wraps all the child components—what’s “inside” the FlatList if you will—and should never have a defined height or flex value. If you need to set a flex: 1 for the FlatList itself use style={{flex: 1}} instead. Cheers!

User contributions licensed under: CC BY-SA
1 People found this is helpful