How to set Refresh Indicator of FlatList in react native?

后端 未结 2 445
名媛妹妹
名媛妹妹 2021-01-04 07:44

I\'m trying to set the refresh indicator of flat list in react native but don\'t know how to do it. List View has this prop :

refreshControl={

        
2条回答
  •  忘掉有多难
    2021-01-04 08:27

    You can pass in the renderScrollComponent to your FlatList component with the same RefreshControl component you have showed above. I have created a expo snack for this: https://snack.expo.io/rJ7a6BCvW

    The FlatList is using VirtualizedList within itself, and for VirtualizedList component, it takes a renderScrollComponent: https://facebook.github.io/react-native/docs/virtualizedlist.html#renderscrollcomponent

提交回复
热议问题