First, transition animation acceptance
A subclass of caanimation for transition effects that can be animated to move or remove a screen from a layer. For example, like Uinavigationcontroller is the use of the transition animation to launch and enter the page.
Include attributes:
Type: Transition types of animations (how to perform transition animations)
Subtype: Transition Direction
Startprogress: Starting point (percentage of overall animation)
Endprogress: Endpoint (percentage of overall animation)
Second, code example
{
Create a transition animation instance
Catransition *ctanima = [catransition animation];
Set Transition type
Ctanima.type = @ "Cude";
Set the transition direction
Ctanima.subtype = Kcatransitionfromleft; Perform transition animations from the left
Animation Execution Time
Ctanima.duration = 1.0f;
Of course, you can also set the start point
ctanima.startprogress = 0.5;
ctanima.endprogress = 0.5;
Last added to the specified view
[Layer Addanimation:ctanima Forkey:nil];
}
Three, the group animation simple Introduction
Also a subclass of Caanimation, you can save an animated set of objects, and when you add caanimationgroup to a layer, all the animations in the group run concurrently.
Include attributes:
Animatitons: An array to save the animation
By default, a set of animated objects is run by a colleague, or you can set the start time by modifying the begintime.
Iv. code Examples
{
Create a few different animations first
Cabasicanimation *b1 = [cabasicanimation animation];
B1.keypath = @ "position"; Translation
B1.byvalue = [Nsvalue valuewithcgpoint:cgpointmake (+)];
Cabasicanimation *b2 = [cabasicanimation animation];
B2.keypath = @ "bounds"; Scaling
B2.tovalue =[Nsvalue valuewithcgrect:cgrectmake (0, 0, $)];
Cabasicanimation *b2 = [cabasicanimation animation];
B2.keypath = @ "transform"; Rotating
B2.tovalue =[nsvalue valuewithcatransform3d:catransform3dmakerotation (m_pi_4, 0, 0, 1)];
And put these animations into the array.
Caanimationgroup *canimag = [caanimationgroup animation];
canimag.animations = @[b1,b2,b3];
canimag.duration = 2.0f;
canimag.removeoncompletion = NO;
canimag.fillmode = kcafillmodeforwards;
Last added to the specified view
[View.layer addanimation:canimag Forkey:nil];
}
This article is from the "11562149" blog, please be sure to keep this source http://11572149.blog.51cto.com/11562149/1784747
The touch of the Core animation (Iv.)