react-native-looped-carousel icon indicating copy to clipboard operation
react-native-looped-carousel copied to clipboard

Switch page

Open hugohow opened this issue 8 years ago • 1 comments

Is there a method for changing dynamically the current page ? I tried with the currentPage props, but it only changes the initial page .

Thanks for this library !

hugohow avatar Nov 30 '16 15:11 hugohow

Ok I did something like this :

         <Carousel
          autoplay={false}
          ref={(carousel) => { this.carousel = carousel; }}
          bullets>
               <TouchableHighlight onPress={() => this.carousel._animateNextPage()}>
                  <Text>Next</Text>
               </TouchableHightlight>
         </Carousel>

If you want to, I can add a more generic example to the README ;)

hugohow avatar Nov 30 '16 16:11 hugohow