Create a bidirectional repeating/looping infinite

2019-05-27 02:52发布

I want to create a scroll that repeats itself, again and again, i.e. when I keep scrolling to the top I reach the last row and when I scroll to the bottom I reach the first row again.

I have tried searching components for the same, but the best I could find were these -

react-native-infinite-scroll and this stackoverflow answer but both of them only tell about how can I load more data when I reach the ScrollView or ListView end.

1条回答
ら.Afraid
2楼-- · 2019-05-27 03:33

I searched a lot for this type component but couldn't find any, so I created my own component from scratch using FlatList, and also published it to npm, so anyone can install it using

npm install react-native-infinite-looping scroll

in your react native project directory.

The component is still in beta so don't expect very good performance from it. But the component is still pretty basic and there's a lot of scope for improvement so anyone who wants to contribute to it can submit a PR here.

查看更多
登录 后发表回答