Forwarded from: http://www.aichengxu.com/article/%CF%B5%CD%B3%D3%C5%BB%AF/16306_12.html
IOS UIVIEW Layer Animation Summary, there is a need for friends can refer to the next.
This is my search for all animated effects, thanks to seniors sharing online.
Page Turn effect animation left [UIView beginanimations:@ "animation" context:nil]; [UIView setanimationduration:1.0f]; [UIView setanimationtransition:uiviewanimationtransitionflipfromright ForView:self.navigationController.view Cache:yes]; [UIView commitanimations]; Page turn effect animation to the right [UIView Beginanimations:nil context:null]; [UIView Setanimationcurve:uiviewanimationcurveeaseout]; [UIView setanimationduration:0.35f]; [UIView setanimationtransition:uiviewanimationtransitionflipfromleft ForView:self.navigationController.view Cache : NO]; [UIView commitanimations]; Lar animation, from top to bottom blur catransition *animation = [catransition animation]; [Animation setduration:2.0f]; [Animation setfillmode:kcafillmodeforwards]; [Animation settimingfunction:[camediatimingfunction Functionwithname:kcamediatimingfunctioneaseout]; [Animation Settype:kcatransitionpush]; [Animation Setsubtype:kcatransitionfrombottom]; [Self.navigationController.navigationBar.layer Addanimation:anImation Forkey:nil]; Folding effect Animation [UIView animatewithduration:0.35f animations:^ {/** * @see http://donbe.blog.163. com/blog/static/138048021201061054243442/* * @param transform deformation attribute (struct), you can use this property to do some flipping or zooming the view. Please poke ↑url. * * @method Valuewithcatransform3d: This method requires a CATRANSFORM3D structure. Some non-detailed explanations can be seen in the following URL * * @see http://blog.csdn.net/liubo0_0/article/details/7452166 * * */Self.navigationcontrolle R.view.transform = Cgaffinetransformmakescale (0.001, 0.001); Cabasicanimation *animation = [cabasicanimation animationwithkeypath:@ "transform"]; Rotate 45° to the right to minimize, then launch from small to large. Animation.tovalue = [Nsvalue valuewithcatransform3d:catransform3dmakerotation (M_PI, 0.70, 0.40, 0.80)]; /** * Other Effects: * To shrink from the bottom up half and then eject * animation.tovalue = [Nsvalue VALUEWITHCATRANSFORM3D:CA TransfoRm3dmakerotation (M_PI, 0.0, 1.0, 0.0)]; * * * Animation.tovalue = [Nsvalue valuewithcatransform3d:catransform3dmakerotation] after fully shrinking from bottom up (M_PI, 1.0, 0.0, 0.0)]; * * Left rotation 45° reduced to minimal, then from small to large launch. * Animation.tovalue = [Nsvalue valuewithcatransform3d:catransform3dmakerotation (M_PI, 0.50,-0.50, 0.50)]; * * Rotate 180° to a minimum and then launch from small to large. * Animation.tovalue = [Nsvalue valuewithcatransform3d:catransform3dmakerotation (M_PI, 0.1, 0.2, 0.2)]; */animation.duration = 2; Animation.repeatcount = 1; [Self.navigationController.view.layer addanimation:animation Forkey:nil]; } completion:^ (BOOL finished) {[UIView animatewithduration:0.35f animations:^ { Self.navigationController.view.transform = Cgaffinetransformmakescale (1.0, 1.0); }]; }]; From bottom to top blur introduced catransition *animation =[Catransition animation]; [Animation setduration:1.0f]; [Animation Settype:kcatransitionreveal]; [Animation Setsubtype:kcatransitionfromtop]; [Animation setfillmode:kcafillmodeforwards]; [Animation settimingfunction:[camediatimingfunction Functionwithname:kcamediatimingfunctioneaseout]; [Self.navigationController.navigationBar.layer addanimation:animation Forkey:nil]; Rotation animation cabasicanimation *rotationanimation = [cabasicanimation animationwithkeypath:@ "Transform.rotation.z"]; Rotationanimation.tovalue = [NSNumber numberwithfloat: (2 * m_pi) * 2]; Rotationanimation.duration = 0.35f; Rotationanimation.timingfunction = [Camediatimingfunction functionwithname:kcamediatimingfunctioneaseineaseout]; Cabasicanimation *scaleanimation = [cabasicanimation animationwithkeypath:@ "Transform.scale"]; Scaleanimation.tovalue = [NSNumber numberwithfloat:0.0]; Scaleanimation.duration = 0.35f; Scaleanimation.timingfunction = [CamediatimingfunctiOn Functionwithname:kcamediatimingfunctioneaseineaseout]; Caanimationgroup *animationgroup = [Caanimationgroup animation]; Animationgroup.duration = 2.35f; animationgroup.autoreverses = YES; Animationgroup.repeatcount = 1; Animationgroup.animations =[nsarray arraywithobjects:rotationanimation, nil]; [Self.navigationController.view.layer addanimation:animationgroup forkey:@ "Animationgroup"]; [UIView commitanimations]; Catransition *animation = [catransition animation]; [Animation setduration:0.8]; /* Various animation effects */* Type////////* Here to pay attention to the use of private methods *//* Pagecurl up a page pageuncurl down one page rippleeffect dripping effect suc Keffect shrinkage effect, such as a piece of cloth is pumped away cube cube effect oglflip upside down effect */[animation settype:kcatransitionreveal]; /* Animation Direction *//* Subtype type */* Kcatransitionfade fade out Kcatransitionmovein cover original Kcatransitionpush launch Kcatra Nsitionreveal Bottom appears also can have four kinds of types: kcatransitionfromright; Kcatransitionfromleft Kcatransitionfromtop; Kcatransitionfrombottom */[animation setsubtype:kcatransitionfrombottom]; /* How fast the animation starts and ends */[animation settimingfunction:[camediatimingfunction Functionwithname: Kcamediatimingfunctioneaseineaseout]]; [Self.navigationController.self.view.layer addanimation:animation Forkey:nil]; The scenario here is that there are already 2 Viewcontroller inserted to the Self.view on/* [Self.view insertSubview:self.blueController.view atindex:0]; [Self.view InsertSubview:self.yellowController.view atindex:1]; */[Self.view exchangesubviewatindex:0 withsubviewatindex:1]; UIView begins the animation, the first parameter is the identity of the animation, and the second parameter attaches the application information used to pass to the animation agent message [UIView beginanimations:@ "animation" context:nil]; Duration of animation [UIView setanimationduration:1.25]; Sets the callback function of the animation, which can be set using the callback method [UIView setanimationdelegate:self]; Set animation curve, control animation speed [UIView setanimationcurve:uiviewanimationcurveeaseinout]; Animate and point out that the animated object [UIView Setanimationtransition:uiviewanimationtransitioncurlup forview:sElf.navigationController.view Cache:yes];//cache/*cache If yes, the start and end picture views are rendered once and frames are created in the animation, otherwise the view will be rendered at each frame. For example, you don't need to keep updating the view transitions, you just have to wait until the conversion is complete before you update the view. Discussion *//Set animation repetition [UIView setanimationrepeatcount:5.0]; Submit UIView Animation End animation [UIView commitanimations]; Start an animated block [UIView beginanimations:@ "Animationid" context:nil]; Set animation duration in animation block (in seconds) [UIView setanimationduration:1.5f]; Sets the curve of the animation property change in the animation block [UIView Setanimationcurve:uiviewanimationcurvelinear]; /* Change curve (uiviewanimationcurveeaseinout,//slow at beginning and end Uiviewanimationcurveeasein, Slow at beginning Uiviewanimationcurveeaseout,//Slow at end uiviewanimationcurvelinear) */ Sets whether the animation effect in the animation block repeats itself automatically. [UIView Setanimationrepeatautoreverses:no]; Set the number of repetitions of an animation in an animation module//setanimationrepeatcount://The agent that sets the animation message. [UIView setanimationdelegate:self]; /* UIView Animation Proxy method//[uiview////Set message to animation agent when the animation starts// Setanimationwillstartselector: @selector (resizeanimationwillstart:context:)];//[uiview////Set message to animation agent when the animation stops// Setanimationdidstopselector: @selector (resizeAnimationDidStop:finished:context:)]; Effect on the specified view */[UIView setanimationtransition:uiviewanimationtransitionflipfromright ForView:self.navigationCo Ntroller.view Cache:yes]; /* Effects also (uiviewanimationtransitionflipfromleft,uiviewanimationtransitionflipfromright, Uiviewanimationtransitioncurlup,uiviewanimationtransitioncurldown) *///display at the front [Self.view exchangesubviewatindex : 1 withsubviewatindex:0]; End animation [UIView commitanimations];