UITableViewCell子视图动画影响多个单元格

时间:2014-11-29 17:29:58

标签: ios uitableview uiview ios8 core-animation

我有一个带有自定义UITableViewCells的UITableView。我在didSelectRow中放置了一个动画,用于隐藏单元格中的一个视图,另一个要显示。当我这样做虽然它影响其他细胞,因为动画也会发生在其他细胞中。

例如,如果我有20个单元格,并且我在indexPath 1处选择单元格,则动画发生在indexPath 1,4,7,10,13,16和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];

我也尝试了其他动画方法,例如[UIView animateWithDuration...],它们都会呈现相同的结果。

帮助?

0 个答案:

没有答案
相关问题