Cat Share, must boutique
Original articles, welcome reprint. Reprint Please specify: Sanayu's Blog
Address: http://blog.csdn.net/u013357243?viewmode=contents
Core animations (Introduction)
Core Animation, the Chinese translation is a central animation, it is a very powerful set of animation processing API, using it can make very beautiful animation effect, and often do more with less. In other words, very powerful functionality can be achieved with a small amount of code.
Core animation can be used on Mac OS X and iOS platforms.
The animation execution of Core animation is performed in the background and does not block the main thread.
It is important to note that theCore animation is directly acting on the Calayer, not uiview.
Steps for using Core animation
1. Use it to first add the Quartzcore.framework framework and introduce the primary header file
Caanimation Inheritance Structure
Caanimation is the parent class for all animation classes, but it cannot be used directly, and its subclasses should be used.
Caanimation Common Properties
Duration: Duration of animation
RepeatCount: Number of repetitions of an animation
Timingfunction: Controlling the rhythm of animation operation
Description
(1) Only 4 subcategories of animated classes are available: Cabasicanimation, Cakeyframeanimation, Catransition, Caanimationgroup
(2) Camediatiming is a protocol (protocol).
Capropertyanimation is a subclass of caanimation, but cannot be used directly, to create an animated object, you should use its two subclasses: Cabasicanimation and Cakeyframeanimation
It has a nsstring type of KeyPath property, you can specify that a property of Calayer is named KeyPath, and the value of this property of Calayer is modified to achieve the corresponding animation effect. For example, specifying @ "position" for KeyPath will modify the value of the position property of the Calayer to achieve a panning animation effect
Add
The parent class of all animated objects, which controls the duration and speed of the animation, is an abstract class that cannot be used directly and should use its specific subclasses
Attribute resolution: (Red represents a property from the Camediatiming protocol)
Duration: Duration of animation
RepeatCount: Number of repetitions of an animation
RepeatDuration: Repetition time of animation
Removedoncompletion: The default is yes, which is removed from the layer after the animation has finished executing, and the drawing reverts to the state before the animation was executed. If you want the layer to remain displayed after the animation has been executed, set it to no, but also set Fillmode to Kcafillmodeforwards
Fillmode: Determines the behavior of the current object during a non-active time period. For example, before the animation starts, the animation ends
BeginTime: Can be used to set the animation delay execution time, if you want to delay 5 seconds, set to Cacurrentmediatime () +5,cacurrentmediatime () is the current time of the layer
Timingfunction: Speed control function to control the rhythm of animation operation
Delegate: Animation agent
Cat learning iOS (38) Introduction to the core animation of the UI