I use react-native-swiper in my home screen, fist time I installed it basically: npm i --save react-native-swiper
then I got an error with viewpagerandroid
and the new version of RN: 0.61.2
. I got that I have to install another version of swiper : npm i --save react-native-swiper@nightly
and then no error but my swiper dont work: buttons are clockable but images don't swipe and i can't swipe it manually. this is my code:
<Swiper
index={this.state.firstSlide}
autoplay={true}
autoplayTimeout= {2}
loop={true}
style={Styles.slider}
showsButtons={true}
showsPagination={true}
buttonTextStyle={{color:'#9e9e9e', fontSize:24}}
>
{this.state.slides.map((item, key) => {
return(
<ImageBackground
key={key}
style={Styles.slide1}
source={{uri: 'https://www.website.com/folder1/api/../' + item.path}}
resizeMode={'cover'}
blurRadius={2}
opacity= {0.7}
>
<Image
source={{uri: 'https://www.website.com/folder1/api/../' + item.path}}
style={Styles.imageStyle}
resizeMode={'contain'}
/>
</ImageBackground>
);
})}
</Swiper>
ps. this code work for me in other project with other version of RN: 0.59.1
and R-N-Swiper
when I try to use juste an easy example:
<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>
button are clickable but this time pagination works to but only the last view is shown!