Open gypsicoder opened 4 years ago
Hi, I'm not the maintainer of the library, but I had a similar problem (I wanted the user to be able to scroll the images with touch and without scrolling)
I solved it this way:
In the SliderBox.js file, there is a onCurrentImagePressedHandler function, this is the on touch function (This is useful in my particular case and not yours, but I'm getting there)
The SliderBox class has a reference ( _ref ) to the Carousel Component
This component has 2 methods: snapToNext and snapToPrev, you can call them to move to next or previous image
I personally made it so if the user clicks the right side of the image it scrolls to the right, and vice versa for the left side
You could make your own function inside SliderBox.js and call it when the user clicks the button (just be sure to save the reference to the slider in your custom class), and solved it this way
If the maintainer is reading this comment, you can implement a custom forward or backwards scroll using this._ref.snapToNext() or this._ref.snapToPrev()
Exactly, check out my fork, I've already implemented this: https://github.com/CodeaIT/react-native-image-slider-box
@mtebele i try your fork but seem only dot is move image is doesn't
I want to have 2 buttons previous and next. And clicking on those buttons I want to change the image of the slider box. Is there any way to do that?