GMGridView
GMGridView copied to clipboard
Frame animations only on second tap
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
This happens to me as well.. have you sorted this out?
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