UITableViewCell rolling animation affects multiple cells

I have a UITableView with custom UITableViewCells. I put animation in didSelectRow for one view in a cell to hide and another to show. When I do this, although it affects other cells, as in the animation it happens to other cells as well.

For example, if I have 20 cells and I select a cell at indexPath 1, the animation happens at indexPath 1, 4, 7, 10, 13, 16, and 19.

CustomCell *cell = (CustomCell *)[tableView cellForRowAtIndexPath:indexPath];

[UIView beginAnimations:@"moveCell" context:nil];
[UIView setAnimationDuration:animationFlipTime];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:cell cache:NO];
[cell.view1 setHidden:NO];
[cell.view2 setHidden:YES];
[UIView commitAnimations];

      

I have also tried other animation methods such as [UIView animateWithDuration...]

and they all display the same result.

reference

+3


source to share





All Articles