问题描述
在我的iPhone应用程序中,我已经在我的UIToolBar中添加了一个类型为UIBarButtonSystemItemTrash的UIBarBUtton。当按下时,我想复制Mail.app的动画:bin打开,UIView折叠并飞进它。
有没有办法通过iPhone SDK访问这个动画?
In my iPhone app, I have put a UIBarBUtton of type UIBarButtonSystemItemTrash in my UIToolBar. When pressed, I'd like to replicate the animation of Mail.app: the bin opens, the UIView folds and flies into it.
Is there a way to access this animation ithrough the iPhone SDK?
目前我使用自定义动画,但有一些限制;例如,我不能动画bin本身。
你有什么建议吗?代码示例?
Presently I am using a custom made animation, but there are some limits; for example, I cannot animate the bin itself.Do you have any suggestion? Code samples?
干脆,
Davide
Cheers,
Davide
推荐答案
对动画使用suckEffect类型。还有:spewEffect,genieEffect,unGenieEffect,扭曲,管,漩涡,cameraIris,cameraIrisHollowClose,cameraIrisHollowOpen,rippleEffect,charminUltra,zoomyIn和zoomyOut。在模拟器中无效。
Use the suckEffect type on an animation. Also: spewEffect, genieEffect, unGenieEffect, twist, tubey, swirl, cameraIris, cameraIrisHollowClose, cameraIrisHollowOpen, rippleEffect, charminUltra, zoomyIn, and zoomyOut. Doesn't work in the simulator.
CATransition *animation = [CATransition animation];
animation.type = @"suckEffect";
animation.duration = 2.0f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
view.opacity = 1.0f;
[view.layer addAnimation:animation forKey:@"transitionViewAnimation"];
注意:代码片段是从更大的代码库中提取的。我希望它的工作原理:)
Note: Code snippet was pulled from a larger codebase. I hope it works :)
这篇关于如何复制Mail.app的垃圾动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!