0
をアニメーション化した後、いくつかの点でをそれをスライドさせ、提示のViewControllerに戻っていないdismissViewControllerAnimated。 私のMainViewControllerからこのコードを使用してモーダルを起動し、それを閉じます。は、私が</strong>で<strong>スライド画面でのViewControllerにしたいのViewController
なぜ解散スライドアニメーションが機能しないのですか?このいずれかの
[presenterVC dismissViewControllerAnimated:NO completion:nil];
:
// Present a React Component sliding from the right on top of current ViewController
+ (void)presentSlidingFromRight:(UIViewController*)presented onViewController:(UIViewController*)presenterVC {
CATransition *transition = [[CATransition alloc] init];
transition.duration = 1;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;
[presenterVC.view.window.layer addAnimation:transition forKey:kCATransition];
[presenterVC presentViewController:presented animated:NO completion:nil];
}
// Dismiss a React Component sliding to the right
+ (void)dismissSlidingToRight:(UIViewController*)presented onViewController:(UIViewController*)presenterVC {
CATransition *transition = [[CATransition alloc] init];
transition.duration = 3;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[presenterVC.view.window.layer addAnimation:transition forKey:kCATransition];
[presenterVC dismissViewControllerAnimated:NO completion:nil];
}
私がYESに設定すると、モーダルはアニメートされますが、デフォルトのアニメーション(下にすばやくスクロールする)が適用されます。なぜ私の移行を無視しているのですか? – Herno
@Hernoの解除機能では、遷移タイプを変更して、プッシュの代わりにフェードを使用してみることができますか? 'transition.type = kCATransitionFade;' – zero
ありがとうございました。したがって、MainView Controllerでコードを実行するとうまく動作します。しかし、私はこの静的なクラスを持っているので、なぜそれがアニメーション化しないのかわかりません。私は、後で使用するために、表現されたコントローラと提示するコントローラを保持しています。これは同じコードですが、MainViewControllerでない別のクラスで使用するとうまくいきません。それはどうしたの? – Herno