I know that we can get the offset with
render() {
return <FlatList
onScroll={this.handleScroll}
/>
}
handleScroll = (event) => {
//get offset by using
//event.nativeEvent.contentOffset
}
But I'm not sure how to set it
Unfortunately contentOffset didn't work for me. I ended up using contentContainerStyle that I found in the ScrollView documentation and it works great.
<FlatList
contentContainerStyle={{ paddingTop: 340 }}
data={data}
/>