skip to Main Content

In React Native, if the items in the FlatList do not fill the screen, the list will not scroll in Android. I need to get the offset Y value for the animation. That’s why I want it to be scrollable, even if it’s small. How can I make it scrollable in this case?

2

Answers


  1. you can scroll only IOS with property bounces: true, nothing you can do with Android.

    Solution: add view to end of flatlist(make sure height > screen.height)

    Login or Signup to reply.
  2. You can use onLayout prop to get the view height instead of the scroll Y offset even though not occurring scroll event.

    onLayout={e=>{
     console.log('height:', e.nativeEvent.layout.height)
    }}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search