如何像地图应用程序一样在iPhone中制作半卷曲动画?

问题描述:

我正在使用以下代码进行页面卷曲动画

I am using the following code for page curl animation

[UIView beginAnimations:@"yourAnim" context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:cacheFlag];
...
[UIView commitAnimations];

是否可以制作iphone/ipod上的maps.app之类的半卷曲动画?

Is it possible to make the half curl animation like the maps.app on iphone/ipod ?

任何想法如何产生相似的效果?

Any ideas how to make an similar effect ?

谢谢

Apple从3.2开始就支持模态视图的显示.这是有道理的:页面卷曲效果是要向用户发出信号,表明正在显示选项或设置页面,完成更改后,它们将被发送回原始视图.苹果公司不希望动画推断页面层次结构的持续变化,只是一种必须返回到其起始位置的模态变化.

Apple does support this for the presentation of modal views as of 3.2. This makes sense: the page curl effect is intended to signal the user that a page of options or settings is being revealed, and when they are done changing things, they will be sent back to the original view. Apple doesn't want the animation to infer an ongoing change to the page hierarchy, just a modal one that must return to its starting place.

使用起来非常简单;只需确保您从全屏视图开始,并使用UIModalPresentationFullScreen样式加载,我相信这是默认样式.

It's pretty straightforward to use; just be sure that you are starting from a full screen view, and loading with the UIModalPresentationFullScreen style, which I believe is the default.

从4.0版开始,通常在UIView中添加了动画过渡以使用类似的效果,但这是使用效果的一种直接方法.

There are animation transitions to use a similar effect in UIViews generally that were added as of 4.0, but this is a straightforward way to use the effect.

simpleVC * myModalVC = [[simpleVC alloc] init];
[myModalVC setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[myModalVC setDelegate:self];

[self presentModalViewController:myModalVC animated:YES];
[simpleVC release];

查看更多