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圖層的動畫組?
我也想知道這個...... –