我想让我的水平 FlatList (启用分页)向左或向右滚动,使内容始终位于屏幕中央,并且下一个和上一个内容仍然出现。
Something like this (for the horizontal actions)
But unfortunately when the flat list is scrolling, the lenght of the scroll is the same of the width of the flat list or its parent and I can't the effect I want.
我们公司有类似的需求,但现有的插件都不能完全满足我们的用例。我们最终创建了自己的并将其开源:react-native-snap-carousel https://github.com/archriss/react-native-snap-carousel/.
该插件现在构建在FlatList
(版本 >= 3.0.0)并提供previews(你想要的效果),捕捉效果, 视差图像, RTL 支持, 和更多。
你可以看看showcase https://github.com/archriss/react-native-snap-carousel#showcase了解它可以实现什么。如果您决定尝试一下,请随时与我们分享您的反馈;我们一直在努力改进它。
Edit : 两个新布局 https://github.com/archriss/react-native-snap-carousel/#layouts-and-custom-interpolations已在版本中引入3.6.0
(一个具有一堆卡片效果,另一个具有类似火种的效果)。享受!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)