IAInfiniteGridView icon indicating copy to clipboard operation
IAInfiniteGridView copied to clipboard

Scrolling to gridViewIndex with animation

Open fvisticot opened this issue 12 years ago • 2 comments

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 ?

fvisticot avatar Jan 22 '13 18:01 fvisticot

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

ikhsan avatar May 17 '13 10:05 ikhsan

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];
    }
}

BlackMarq20 avatar Sep 09 '13 02:09 BlackMarq20