私は周りを見回しましたが、私が探していたものを正確に見つけられませんでした。
ビュー コントローラを押すときにフリップ アニメーションを取得する方法はありますか?
モーダルビューコントローラーを使用してアニメーションを変更できると読みましたが、モーダルビューのアニメーションは下から上にあり、それは私が探しているものではありません。どういうわけかフリップアニメーションを取得する方法はありますか?
このようなものはうまくいくはずです
[UIView beginAnimations:@"animation" context:nil];
[self.navigationController pushViewController: yourviewcontroller animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
pushViewController を呼び出すときは、animate を NO に設定することを忘れないでください
これも機能します..iOS 4.0 and greater
[UIView transitionWithView:self.navigationController.view duration:0.8 options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^(void) {
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
[self.navigationController pushViewController:viewController animated:YES];
[UIView setAnimationsEnabled:oldState];
}
completion:nil];
- (void)viewWillDisappear:(BOOL)animated {
[UIView beginAnimations:@"animation2" context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration: 0.7];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations]; }
新しいviewcontrollerでは、ツールバーの戻るボタンが押されたときに(左にスライドするのではなく)同じようにフリップバックします-ここでアニメーションが有効になっていることを確認してください。たとえば、スタックをポップするカスタムボタンを作成する場合は、 :
- (void) backToPrevious: (id) sender
{
//[self.navigationController popViewControllerAnimated:YES];
[self dismissModalViewControllerAnimated:YES];
}
モーダルに表示されるビューコントローラの場合、プロパティを使用してアニメーションを変更できmodalTransitionStyle
ます。ちなみに、ナビゲーションコントローラーのプッシュアニメーションを変更する方法はありません(UINavigationControllerを最初から再構築する場合を除く)。