2つのビュー(redView、blueView)を含むView Controllerが1つあります。ビューはメインビューよりも小さくなっています。UIViewcontroller.viewアニメーションとサブビューの切り替え
アニメーションでredViewからblueViewに変更したいと思います。これを使用しない場合、アニメーションは発生しません。私はこれにコードを変更する場合には
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight
forView:redView cache:YES]; // !!! I WILL CHANGE THIS
[self.view addSubview:blueView];
[redView removeFromSuperview];
[UIView commitAnimations];
、その後、アニメーションはOKですが、全体MAINVIEWは、私が起こることをしたくない何かをアニメーション化します。サブビューだけを反転させたい2つのサブビューが同じ位置にあることに注意してください。 (フレーム)どんなアイデアですか?あなたの最初の例で
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight
forView:self.view cache:YES];
[self.view addSubview:blueView];
[redView removeFromSuperview];
[UIView commitAnimations];
感謝を割り当てられますが、それは動作しませんでした。私は解決策を見つけました。 [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:tempView キャッシュ:はい]; [tempView addSubview:view2]; [view1 removeFromSuperview]; [UIView commitAnimations]; –
私の評判のためにまだ投稿できません –