问题
// 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