PresentModalViewControllerを、ナビゲーションコントローラの「pushViewController」メソッドを使用するときに表示されるのと同じアニメーションで使用できますか?ナビゲーションコントローラのプッシュビューと同じアニメーションのPresentModalViewController?
2
A
答えて
1
私が知る限り、それは水平に動かすことはできません。さらに、presentModalViewController:animated:
を使用すると、前のビューは表示されなくなります(空白になります)。しかし、あなたは(あなたのウィンドウの上部に、ご希望のビューを追加)このように行うことができます:私は上記の代わりに、承認された解答のUIStoryboardSegue
をお勧めします
UIViewController *modalViewController = [[UIViewController alloc] init];
[modalViewController.view setFrame:CGRectMake(320.0f, 0.0f, 320.0f, 480.0f)];
[modalViewController.view setBackgroundColor:[UIColor redColor]];
[[UIApplication sharedApplication].delegate.window addSubview:modalViewController.view];
[UIView animateWithDuration:0.25f
delay:0.0f
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
[modalViewController.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
}
completion:nil];
[modalViewController release];
0
。エフェクトとビュー階層を実現するのが適切な方法だと思われます。
presentModalViewController:animated:
と一緒に、「実行する」の下に記載されているように使用できます。
関連する問題