3

私の iPhone アプリでは、いくつかのモーダル ビューを使用しています。新しいViewControllerを提示するとき、私は常にトランジションアニメーションの1つを使用します

(UIModalTransitionStylePartialCurl,UIModalTransitionStyleFlipHorizontal
UIModalTransitionStyleCoverVertical,UIModalTransitionStyleCrossDissolve)

私が探しているのは と呼ばれるUIModalTransitionStyleCoverHorizontalものですが、そのようなものはありません。ただし、多くのアプリケーション (iOS とサードパーティの両方) で、この水平方向のカバーの移行が見られます。

これを達成する方法を知っている人はいますか?

4

2 に答える 2

2

I answer my question too. What @Max Justicz said is one way to do it. The other way is to have it done in a UINavigationController.

You create the UIViewController where you want to navigate from:

UIViewController* controller1 = [[UINavigationController alloc]init];

Also create a UINavigationController and init it with the controller

UINavigationController* controllerNVC = [[UINavigationController alloc]initWithRootViewController: controller1];

Then in "controller's .m" file when you want to navigate, do it like this.

UIViewController* controller2 = [[UINavigationController alloc]init];
[[self navigationController] pushViewController:controller2 animated:YES];

this will push a controller2 onto controller1.

When you want to go back from controller2 just call this:

[[self navigationController]popViewControllerAnimated:YES];

This way you can have a horizontalcover animated way to navigate between views

于 2012-08-14T14:30:44.900 に答える
0

これはあなたの質問に答えるはずです。これはちょっとしたハックですが、基本的には、遷移先のビューを現在のビュー フレームの外に配置することで、アニメーションをより細かく制御できます。

お役に立てれば!

于 2012-08-10T16:07:38.960 に答える