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

If support cycle scroll and timing rolling, it will be good. #2

Open
zhw511006 opened this issue Apr 21, 2015 · 1 comment
Open

If support cycle scroll and timing rolling, it will be good. #2

zhw511006 opened this issue Apr 21, 2015 · 1 comment

Comments

@zhw511006
Copy link

No description provided.

@mohreda
Copy link

mohreda commented Mar 12, 2016

i support timing rolling for the code;
you can use this method

  • (void)scrollingTimer {
    CGFloat contentOffset = self.scrollView2.contentOffset.x;
    // calculate next page to display
    int nextPage = (int)(contentOffset/self.scrollView2.frame.size.width) + 1 ;
    // if page is not 10, display it
    if( nextPage!=6 ) {
    [self.scrollView2 scrollRectToVisible:CGRectMake(nextPage*self.scrollView2.frame.size.width, 0, self.scrollView2.frame.size.width, self.scrollView2.frame.size.height) animated:YES];
    self.customStoryboardPageControl.currentPage=nextPage;
    // else start sliding form 1 :)
    } else {
    [self.scrollView2 scrollRectToVisible:CGRectMake(0, 0, self.scrollView2.frame.size.width, self.scrollView2.frame.size.height) animated:YES];
    self.customStoryboardPageControl.currentPage=0;
    }
    }

enjoy

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