Cat Share, must boutique
Original articles, welcome reprint. Reprint Please specify: Sanayu's Blog
Address: http://blog.csdn.net/u013357243?viewmode=contents
SOURCE Material Address: http://blog.csdn.net/u013357243/article/details/45583465
Effect:
Code:
In fact, the code is very small, the apple is packaged
// 1.创建核心动画 CATransition *ca = [CATransition animation]; // 1.1动画过渡类型 ca.type = @"cube"; // 1.2动画过渡方向 ca.subtype = kCATransitionFromRight; // 1.3动画起点(在整体动画的百分比) //ca.startProgress = 0.5; //1.3动画终点(在整体动画的百分比) //ca.endProgress = 0.5; // 动画时间 1; // 2.添加核心动画 [self.iconView.layer addAnimation:ca forKey:nil];
Here have children's shoes say wrong, say a lot of line, cat to simplify Ha, still left three lines, but strictly speaking, Ca.type = @ "Cube";
CATransition *ca = [CATransition animation]ca.type = @"cube";[self.iconView.layer addAnimation:ca forKey:nil];
Catransition Session Animation
Just one type will take care of such a cool transition animation. The cat says the previous Android use a translation animation to cry.
Attention:
A subclass of Caanimation, used for transition animations, to provide layers with animated effects for moving out of the screen and moving into the screen. iOS has less transition animations than Mac OS X
Uinavigationcontroller is the animation effect of pushing the controller's view into the screen via catransition
Attribute parsing:
Type: Animation transition types
Subtype: Animation transition Direction
Startprogress: Start of Animation (percentage in overall animation)
Endprogress: End of Animation (percentage in overall animation)
Transition effect
Fade//Crossfade Transitions (transition direction not supported)Kcatransitionfade push//New View roll out the old view Kcatransitionpush Movein//New view above the old view Kcatransitionmovein reveal//move the old view away, display the new view below Kcatransitionr Eveal cube//cube Rollover effectOglflip//Upper and lower left and right rollover effectSuckeffect//shrinkage effect, such as a piece of cloth is taken away (does not support the transition direction)Rippleeffect//Drip effect (transition direction not supported)Pagecurl//Page UP effectPageuncurl//Page DOWN effectCamerairishollowopen//Camera lens open effect (does not support transition direction) Camerairishollowclose//Camera lens Close effect (no transition direction is supported)Transition Direction Kcatransitionfromright Kcatransitionfromleft The use of kcatransitionfrombottomkcatransitionfromtopcatransition catransition *anim = [Catransition animation];anim.type= @ "Cube";//Animation transition typeAnim.subtype = Kcatransitionfromtop;//Animation transition DirectionAnim.duration =1;//animation lasts 1s//Agent, the delegate's animationdidstop:finished is called when the animation finishes executing:Anim.delegate = self;/******* The code that changes the Layer property in the middle **********/[Layer Addanimation:anim Forkey:nil];
Cat learn iOS (41) UI core animation two lines of code to fix 3D transitions (do Android crying)