CATransition transition Animation
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: [objc] view plaincopyprint? <Span style = "white-space: pre"> </span> // 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. subt Ype = kCATransitionFromBottom; // Add an animation [self. changeView. layer addAnimation: transition forKey: nil]; in general, we set the animation type to use the provided enumerated value. by accident, transition animation can also recognize strings in some OC. usage: [objc] view plaincopyprint? Transition. type = @ "rippleEffect"; below 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)
What is transition animation?
It is the content of the first and last two key frames of an animation. The intermediate frame is calculated by the computer based on the features and animation nature requirements of the first and last two frames.
What is the role of transition animation frames?
The animation between two key frames (original image) is called a transition frame.
Here we will talk about the animation production process. First we need to draw the original image and then make the original words into an animation.
If the original image is directly spliced by technical means, the effect will be very poor. There will be a so-called card frame. At this time, the transition frame is required for the transition.
Transition frames are mainly placed between two key frames of the animation, which improves the intermediate effect of the animation.