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

Animation on scrollview #5

Open
ghost opened this issue Sep 14, 2011 · 1 comment
Open

Animation on scrollview #5

ghost opened this issue Sep 14, 2011 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 14, 2011

It would be nice to allow the developer to set a desired animation style instead of scrolling when changing pages.

@adnanAhmad786
Copy link

Hi you are able to add desired animation.Go to ATPageView.m in configurePages method.

see this section you are able to add animation their that will reflect on page change.I have just show how to use animation.if you want to support different animations and want user to select their types by making settings screen.one solution for that is to make enum and change your code accordingly.

// add missing pages
    for (int index = firstPage; index <= lastPage; index++) {
        if ([self viewForPageAtIndex:index] == nil) {
            // only preload visible pages in quick mode
            if (quickMode && (index < firstVisiblePage || index > lastVisiblePage))
                continue;
            UIView *page = [_delegate viewForPageInPagingView:self atIndex:index];

            [self configurePage:page forIndex:index];

         ///add Animation their///

            [UIView animateWithDuration:1.0 delay:0.0
                                options:UIViewAnimationOptionTransitionCrossDissolve
                             animations:^{page.alpha=0.5;}
                             completion:^(BOOL fin) {

                                 page.alpha=1.0;
                             }];

            [_scrollView addSubview:page];
            [_visiblePages addObject:page];
        }
    }

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

1 participant