我有以下动画块:
[UIView animateWithDuration:3.0 animations:^{
NSLog(@"INDEX %d", index);
[self.visibleViewControllers_ enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
UIViewController *viewController = (UIViewController *)obj;
if (viewController.view.tag != index){
if (viewController.view.tag < index){
NSLog(@"LOWER VIEW WITH TAG %d", viewController.view.tag);
[viewController.view setFrameY:self.contentOffset.y - viewController.view.frameHeight];
} else if (viewController.view.tag > index){
NSLog(@"UPPER VIEW WITH TAG %d", viewController.view.tag);
[viewController.view setFrameY:600];
} else {
[viewController.view setFrame:CGRectMake(0, self.contentOffset.y, selectedView.frameWidth, 460)];
}
}
}];
//[selectedView setFrame:CGRectMake(0, self.contentOffset.y, selectedView.frameWidth, 460)];
}completion:^(BOOL finished){
[self.visibleViewControllers_ enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
UIViewController *viewController = (UIViewController *)obj;
NSLog(@"VIEW CONTROLLER Y IS %f AT INDEX %d", viewController.view.frameY, viewController.view.tag);
}];
}];
基本上它是一个视图控制器字典,它是我想要动画的视图,但奇怪的是它只执行一个动画。不是全部。为什么是这样?是否可以在动画块内进行枚举?