首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React Native -如何创建垂直覆盖?

React Native -如何创建垂直覆盖?
EN

Stack Overflow用户
提问于 2017-06-21 19:12:12
回答 1查看 72关注 0票数 1

我只是想知道,在React Native中,是否可以创建一个垂直覆盖;我的意思是,在页面上,当向下滑动时,一个覆盖下来,覆盖着页面,上面有各种信息(向上滑动时也是如此,覆盖来自底部)。一开始我想使用react-native-swiper,但垂直滑动与Android不兼容。所以,如果有人有其他的解决方案,请便!谢谢

EN

回答 1

Stack Overflow用户

发布于 2017-06-21 19:58:21

请查看react-native-parallax-view,希望这能帮助你。

编辑

示例:

代码语言:javascript
复制
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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44674482

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档