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

Scrolling to gridViewIndex with animation #8

Open
fvisticot opened this issue Jan 22, 2013 · 2 comments
Open

Scrolling to gridViewIndex with animation #8

fvisticot opened this issue Jan 22, 2013 · 2 comments

Comments

@fvisticot
Copy link

There is a method (jumpToIndex) to go directly to a page Index but without scrolling animation.
How to have this same method with scrolling animation ?

@ikhsan
Copy link
Owner

ikhsan commented May 17, 2013

This is still a problem for me to implement. Scrolling to offset using setContentOffset doesn't fire scrollDidView hence the grids' creation didn't work properly

@BlackMarq20
Copy link

I've found an alternative, if you use a tapGestureRecognizer with a separate method and call the setContentOffset within that, it seems to work properly (at least for my usage of it).

-(void) headerTapped:(id) sender {
    //get the point that was tapped within the context of the topScrollView (not the wrapper)
    CGPoint newPoint = [sender locationInView:self];
    UIView *result = [self gridViewAtPoint:newPoint];

    if (self.gridDelegate && [self.gridDelegate respondsToSelector:@selector(infiniteGridView:didSelectGridAtIndex:)]) {
        [self setContentOffset:CGPointMake(result.frame.origin.x, 0) animated:YES];
        [self.gridDelegate infiniteGridView:self didSelectGridAtIndex:result.tag];
    }
}

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

3 participants