GMGridView icon indicating copy to clipboard operation
GMGridView copied to clipboard

Frame animations only on second tap

Open jpsim opened this issue 12 years ago • 2 comments

This code should animate the tapped cell 10px right while changing its color to green. The frame animation never runs the first time. Ideas?

- (void)GMGridView:(GMGridView *)gridView didTapOnItemAtIndex:(NSInteger)position
{
    GMGridViewCell *cell = [_gmGridView cellForItemAtIndex:position];
    [UIView animateWithDuration:0.5 
                          delay:0 
                        options:UIViewAnimationOptionBeginFromCurrentState
                     animations:^{
                         cell.center = CGPointMake(cell.center.x+10,cell.center.y);
                         cell.contentView.backgroundColor = [UIColor greenColor];
                     } 
                     completion:^(BOOL finished){
                     }
     ];
}

Here's an example video: http://dl.dropbox.com/u/3027105/GMAnimation.mov

jpsim avatar May 08 '12 19:05 jpsim

This happens to me as well.. have you sorted this out?

franzhcs avatar Jun 22 '12 08:06 franzhcs

I mean, I know what happens: the gridView layoutSubviews method is issued and it repositions the cells to their correct location.

Still, I don't understand why this occurs only the first time

franzhcs avatar Jun 22 '12 08:06 franzhcs