xcode 如何为 UIViewAnimationTransitionCurlUp 之类的视图设置动画?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1455478/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:51:31  来源:igfitidea点击:

How to animate a view like UIViewAnimationTransitionCurlUp?

iphonexcodeuiview

提问by Sagar R. Kothari

I want to animate a view like UIViewAnimationTransitionCurlUp.

我想动画一个视图UIViewAnimationTransitionCurlUp

I don't know the exact way.

我不知道确切的方法。

回答by coneybeare

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.2];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:yourView cache:YES];
[yourView changeSomethingToThePositionOrWhatever];
[UIView commitAnimations];

回答by damithH

[UIView beginAnimations:@"" context:nil];   
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];  
[UIView setAnimationDuration:1.0];

// Make your changes
// show and hide views


[UIView commitAnimations];

also check docs

还检查文档