leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.42k stars 2.34k forks source link

How to disable prev swipe and prev button only next i want with swipe and next button #800

Open dwivediamit opened 6 years ago

dwivediamit commented 6 years ago

<Swiper showsButtons={true} loop={false} index={0} onIndexChanged={(index) => this.statusChange(index)} showsPagination={false} prevButton={false} >

        <Appointment_status navigation={this.props.navigation} />
        <Appointment_statuspending navigation={this.props.navigation} />
        <Arrived navigation={this.props.navigation} />
        <Completed navigation={this.props.navigation} />
        <Appointment_complete navigation={this.props.navigation} />

      </Swiper>
akkravikumar commented 5 years ago

@dwivediamit scrollEnabled = {false}

   <Swiper loop={false}
          ref={(component) => { this.swiper = component; }} 
          showsPagination={false}
          scrollEnabled={false}  // Use this for disable swipe.
          index={0}>
   .....
  </Swiper>

  onPress=()=> {
     this.swiper.scrollBy(2)
  }