PopViewControllerAnimatedのページを「カールダウン」できますか?
-
02-10-2019 - |
質問
このコードでビューコントローラーを「カールアップ」できます。
[UIView beginAnimations:@"animation" context:nil];
[self.navigationController pushViewController:page animated:NO];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
しかし、私はこのように最後のページをカールダウンすることはできません:
[UIView beginAnimations:@"animation" context:nil];
[self.navigationController popViewControllerAnimated:NO];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
どうして考えてみませんか?私は本当にアニメーションを「逆」したいだけです(まるで「プッシュ」ビューコントローラーを表示し、ボタンをクリックすると戻ってくるようにステッカーが剥がされたかのように)。
ありがとう
解決
わかりました、私の古い答えは完全に間違っていました...問題は、移行ビューを設定する前にビューコントローラーをポップしていることです。これにコードを変更した場合:
[UIView beginAnimations:@"animation" context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
[self.navigationController popViewControllerAnimated:NO];
[UIView commitAnimations];
正常に動作します
他のヒント
OpenGLまたは多くの複雑なCoreAnimationプロセスを使用して、私はあなたができると確信していますが、それはそのようなことをするのに多くの手間がかかるでしょう。あなたを助けるかもしれない何か: CoreAnimationで完全に書かれた簡単な本のターニングアプリケーション
所属していません StackOverflow