有没有办法将react-native-swiper与react-naitve-parallax-scroll-view结合起来。我想在视差滚动的前景组件中呈现 swiper 组件的分页。默认情况下,react native swiper 的分页具有固定位置,当我滚动时,分页保持在屏幕上。我希望在向下滚动以隐藏时具有分页视差效果。分页应该在视差滚动视图的 renderForeground 中。
<Swiper
showsButtons={false}
loop={false}
showsPagination={true}
>
<ParallaxScrollView
backgroundColor="transparent"
contentBackgroundColor="#fff"
parallaxHeaderHeight={250}
renderBackground={() => (
<ImageBackground
source={require('../assets/images/image1.png')}
style={{width: '100%', height: 250}}
/>
)}
renderForeground={() => (
<View style={{flex: 1,alignItems: 'center', justifyContent: 'flex-end' }}>
<Text>Hello world</Text>
</View>
)}>
<View style={{ height: 500 }}>
<Text>Scroll me</Text>
</View>
</ParallaxScrollView>
<ParallaxScrollView
backgroundColor="transparent"
contentBackgroundColor="#fff"
parallaxHeaderHeight={250}
renderBackground={() => (
<ImageBackground
source={require('../assets/images/image1.png')}
style={{width: '100%', height: 250}}
/>
)}
renderForeground={() => (
<View style={{flex: 1,alignItems: 'center', justifyContent: 'flex-end' }}>
<Text>Hello world</Text>
</View>
)}>
<View style={{ height: 500 }}>
<Text>Scroll me</Text>
</View>
</ParallaxScrollView>
</Swiper>
我找到了react-native-pagination但不知道如何在这种情况下实现。