2017-06-21 69 views
1

我只是想知道,在React Native中是否有可能创建一个垂直叠加层;因此,我的意思是在一个页面上,当向下滑动时,一个覆盖层下来,覆盖页面,上面有各种信息(滑动时相同,底层覆盖层)。我想首先使用react-native-swiper,但是垂直刷卡与Android不兼容。所以如果有人有另一种解决方案可以提供,请成为我的客人!谢谢React Native - 你如何创建一个垂直覆盖?

回答

0

检查react-native-parallax-view希望这可以帮助你。

编辑

例如:

return (
    <View style={[{ flex: 1 }]}> {/* add parent container and then ParallaxView as specified in documentation */} 
     <ParallaxView 
      backgroundSource={require('image!backgroundImage')} 
      windowHeight={300} 
      header={(
       <Text style={styles.header}> 
        Header Content 
       </Text> 
      )} 
      scrollableViewStyle={{ backgroundColor: 'red' }} 
      > 
      <View> 
      // ... scrollview content 
      </View> 
     </ParallaxView> 
    </View> 
); 
+0

谢谢,我现在要检查! – BrtD

+0

嘿,你有没有关于如何使它工作的例子?我遇到了一些麻烦,我似乎无法在网上找到一些明确的例子。 – BrtD