Yup*_*aks 5 android react-native
我正在寻找一种以特定间隔滚动水平菜单的方法.
I have multiple children visible on screen

选定的州处于中心位置.
将snapToInterval与snapToAlignement结合使用可以满足我的需求,但这些道具仅适用于iOS.
有没有办法实现这个目标?我想PanResponder API可以使用,但我不知道如何实现它.
我使用0.28 RN版本.谢谢.
<ScrollView
decelerationRate={0}
horizontal
snapToAlignment="center"
snapToInterval={150}
>
{this.props.children}
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
有一个关于此问题的拉取请求:https://github.com/facebook/react-native/pull/15297
还有一个库https://github.com/machadogj/react-native-carousel-control?files=1支持 Android 和 iOS 滑动,它控制滚动行为本身,但我尝试了,它有效,但与snapToInterval和相比就不那么顺利了snapToAlignment。
另一种但更复杂的轮播滑动在这里:https ://github.com/archriss/react-native-snap-carousel
希望您能基于这些获得更多见解。
| 归档时间: |
|
| 查看次数: |
3690 次 |
| 最近记录: |