react-native react-native-swiper 设置horizontal=false无效

来源:互联网 发布:mysql against ngram 编辑:程序博客网 时间:2024/05/22 04:52

react-native react-native-swiper 设置horizontal=false后界面依然横向滑动,
主要是对布局进行了旋转操作

export  default class TestSwiper extends Component {    render(){        return (            <View style={styles.containerStyle}>                <Swiper                    showsPagination={false}                    autoplay                >                    <Text style={[{backgroundColor:"#f0f"},styles.pageStyle]}>界面1</Text>                    <Text style={[{backgroundColor:"#ff0"},styles.pageStyle]}>界面2</Text>                    <Text style={[{backgroundColor:"#00f"},styles.pageStyle]}>界面3</Text>                </Swiper>            </View>        )    }}const styles=StyleSheet.create({    containerStyle:{        backgroundColor:"#000",        //旋转90度        transform:[{rotate: "90deg"}],        height:100,        width:100,    },    pageStyle:{        height:100,        width:100,        //旋转-90度        transform:[{rotate: "-90deg"}]    }})

这里写图片描述

原创粉丝点击