2
我动画一个UIView过渡,像这样:结合UIView和子视图的CALayer上的动画?
UIView *areaView = areaController.view;
[areaController viewWillAppear:YES];
UIView *subView = self.customView.subView;
UIButton *button = customView.button; // button is a subview of customView.subView
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:subView cache:YES];
[button removeFromSuperview];
[subView addSubview:areaView];
[areaController viewDidAppear:YES];
[UIView commitAnimations];
[self.areaController start]; // areaController starts the animation of the CALayer, see below
这翻转的新观点,areaView从“后面”按钮就好了,但在areaView有被其动画另一个子视图的CALayer的:
CATransform3D rotate = CATransform3DMakeRotation(angle, 1, 0, 0);
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.toValue = [NSValue valueWithCATransform3D:rotate];
animation.duration = .08;
animation.delegate = self;
animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;
[layer addAnimation:animation forKey:@"transform"];
我的问题是:
怎样使这两个动画在parallell动画?
当前,调用[self.areaController start];
时,CALayer上的动画开始,但在superview转换完成之前,结果不可见。我应该以某种方式使用UIView图层的动画组?
我也想知道这个...... –