如何实现像原始iPhone谷歌地图应用程序的折叠动画视图?

时间:2009-09-24 16:22:01

标签: iphone

所有编码器,我在原版iPhone谷歌地图应用程序中看到了折叠动画视图,我希望在我的视图中有相同的效果,但我还没有找到解决方案...

如何通过iPhone sdk做同样的动画?任何提示将不胜感激......

感谢...

iRobin

1 个答案:

答案 0 :(得分:1)

我相信您所寻找的是UIViewAnimationTransitionCurlUpUIViewAnimationTransitionCurlDown,这两种过渡效果可以在切换视图时应用。要产生效果,您可以使用如下代码:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:CURLANIMATIONDURATIONFORSWITCHINGVIEWS];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];

[newlyVisibleController viewWillAppear:YES];
[previouslyVisibleController viewWillDisappear:YES];
[previouslyVisibleController.view removeFromSuperview];
[self.view addSubview:newlyVisibleController.view];
[previouslyVisibleController viewDidDisappear:YES];
[newlyVisibleController viewDidAppear:YES];

[UIView commitAnimations];