How to make “suckEffect” to the left corner of iPhone?

喜夏-厌秋 提交于 2019-12-21 05:42:53

问题


// Begin Animation "suckEffect".
CATransition* animation  = [CATransition animation];
animation.type           = @"suckEffect";
animation.duration       = 1.0f;
animation.timingFunction =  UIViewAnimationCurveEaseInOut;
myView.opaque            = 1.0f;
[myView.layer addAnimation:animation forKey:@"transitionViewAnimation"];

How you can see I write a part of code witch make an animated when I press delete button. When I press delete button in my application the "suckEffect" take place. But it goes to left corner of the screen. I want to ask you if anybody know how can I do this effect but for left corner of my iphone screen !!!


回答1:


You can use the undocumented +[UIView setAnimationPosition:]. Beware that the suckEffect is undocumented and Apple will reject apps using it. Same for setAnimationPosition:.




回答2:


If you don't want to violate apple store rules, you could use a third party library to do the effect, for instance:

https://github.com/Ciechan/BCGenieEffect



来源:https://stackoverflow.com/questions/5272916/how-to-make-suckeffect-to-the-left-corner-of-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!