Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto scroll #33

Open
ManishAhire opened this issue Nov 2, 2018 · 1 comment
Open

Auto scroll #33

ManishAhire opened this issue Nov 2, 2018 · 1 comment

Comments

@ManishAhire
Copy link

I'm not able to do automatic scrolling of pages. After some time I want to scroll next page automatically.

How can. I do?

@tomleclercq
Copy link

tomleclercq commented Apr 4, 2019

You can use timer.setInterval from react-native-timer and the function "scrollToPage"
here is a function I used:

autoSlide = () => {
        timer.setInterval(this, "AutoSlide", () => {
            const index = this.state.currentPageIndex < this.pageCount - 1 ? this.state.currentPageIndex + 1 : 0;
            this.refs.pages.scrollToPage(index);
        }, config.SlideDelay);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants