During the mobile development process, animations are essential and animated as if our program had life. Animations can make our program interface more fluid, not very abrupt. Today, let's talk about the catransition transition animation.
Let's take a look at the code implementation of the Transition animation:
<span style= "White-space:pre" ></span>//create catransition *transition = [catransition animation]; Transition.duration = 2; Set transition style /** Types: kcatransitionfade kcatransitionmovein kcatransitionpush Kcatransitionreveal * ///style transition.type = kcatransitionreveal; /** * subtypes: kcatransitionfromright; Kcatransitionfromleft; Kcatransitionfromtop; Kcatransitionfrombottom; * ///direction transition.subtype = Kcatransitionfrombottom; Add animation [Self.changeView.layer addanimation:transition Forkey:nil];
In general, we set the type of animation to use the provided enumeration value. Accidental discovery, transition animations can also recognize strings in OC.
How to use:
Transition.type = @ "Rippleeffect";
Here are some of the types of animations you can use:
fade //Crossfade Transitions (transition direction not supported)
push //New View roll out the old viewMovein //New view above the old view reveal //move the old view away to show the new view belowcube //cube Rollover effect oglflip //Upper and lower left and right rollover effectsuckeffect //shrinkage effect, such as a piece of cloth is pumped away (not support transition direction)rippleeffect //Drip effect (transition direction not supported)pagecurl //Page UP effectpageuncurl //Page DOWN effectCamerairishollowopen//Camera lens open effect (transition direction not supported)camerairishollowclose//Camera lens Close effect (no transition direction is supported)
Types of catransition transition animations in iOS development