Create a bidirectional repeating/looping infinite scrollView in react native

本秂侑毒 提交于 2019-12-22 12:45:13

问题


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:


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.



来源:https://stackoverflow.com/questions/51149784/create-a-bidirectional-repeating-looping-infinite-scrollview-in-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!