ReactNative 学习笔记 Open Source - react-native-swiper

Posted on By Vivian Sun

react-native-swiper

Swiper component for React Native.

  1. Install react-native first

    $ npm i react-native-swiper –save

  2. rm react-native first

    $ npm rm react-native-swiper –save

关键代码:

import Swiper from 'react-native-swiper'

render(){
    return (
        <Swiper style={styles.wrapper} showsButtons={true}>
            <View style={styles.slide1}>
                <Text style={styles.text}>Hello Swiper</Text>
            </View>
            <View style={styles.slide2}>
                <Text style={styles.text}>Beautiful</Text>
            </View>
            <View style={styles.slide3}>
                <Text style={styles.text}>And simple</Text>
            </View>
        </Swiper>
    );
}

Sample Code

More Example

官网API地址

react-native-swiper github