Types of CATransition transition animation in iOS development
Animation is essential during mobile development. With animation, it seems that our program has a life. animation can make our program interface changes smoother, rather than abrupt. today, let's talk about the CATransition transition animation.
Let's take a look at the code implementation of the Transition Animation:
// Create CATransition * transition = [CATransition animation]; transition. duration = 2; // set the transition style/** Types: kCATransitionFade kCATransitionMoveIn kCATransitionPush kCATransitionReveal * // style transition. type = kCATransitionReveal;/*** Subtypes: kCATransitionFromRight; kCATransitionFromLeft; kCATransitionFromTop; kCATransitionFromBottom; * // transition. subtype = kCATransitionFromBottom; // Add an animation [self. changeView. layer addAnimation: transition forKey: nil];
In general, we set the animation type to use the provided enumerated values. By accident, the transition animation can also recognize some strings in OC.
Usage:
transition.type = @"rippleEffect";
The following are some animation types that can be used:
Fade // cross fade transition (transition direction not supported)
Push // The New View pushes the old view out of moveIn // The New View is moved to the old view and reveal // removes the old view, show the following new view cube // cube tumble effect oglFlip // top, bottom, left, and right flip effect suckEffect // contraction effect, such as a piece of cloth being drawn (transition direction not supported) rippleEffect // drip effect (transition direction not supported) pageCurl // page up effect pageUnCurl // page down effect cameraIrisHollowOpen // camera lens opening effect (transition direction not supported) cameraIrisHollowClose // camera lens close effect (transition direction not supported)