react-native-swiper
Swiper component for React Native.
-
Install react-native first
$ npm i react-native-swiper –save
-
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>
);
}