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

How to make half curl animation in iPhone like the maps app?(如何像地图应用一样在 iPhone 中制作半卷曲动画?)

本文介绍了如何像地图应用一样在 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 不希望动画推断页面层次结构的持续变化,而只是一种必须返回其起始位置的模式.

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.

在 UIViews 中使用类似效果的动画转换通常是在 4.0 中添加的,但这是使用效果的直接方式.

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];

链接到关于 UIModalTransitionStyle 常量的 Apple 文档

这篇关于如何像地图应用一样在 iPhone 中制作半卷曲动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:如何像地图应用一样在 iPhone 中制作半卷曲动画?

基础教程推荐