Uiviewanimation animation and catransition animation of core Animation

Source: Internet
Author: User

1. Use the uiview function to implement:

// Uiviewanimationtransitionflipfromleft, left
// Uiviewanimationtransitionflipfromright, turn to the right
// Uiviewanimationtransitioncurlup, flip up
// Uiviewanimationtransitioncurldown, flip down

[Uiview beginanimations: @ "animationid" context: Nil];
[Uiview setanimationduration: 0.5f]; // animation duration
[Uiview setanimationcurve: uiviewanimationcurveeaseinout];
[Uiview setanimationtransition: uiviewanimationtransitionflipfromleft forview: Self. View cache: Yes]; // Add a transition effect to the view
// Write your code here.
[Uiview commitanimations]; // submit an animation

 

2. Use the catransition object to implement:

Catransition is relatively powerful. Generally, you can use catransition to simulate the uiview animation.

/* Transition effect
Fade // cross fade transition (transition direction not supported)
Push // New View releases old view
Movein // move the new view to the old view
Reveal // remove the old view to display the new view below
Cube // cube tumble Effect
Oglflip // top, bottom, left, and right flip
Suckeffect // contraction effect, such as a cloth being drawn (transition direction not supported)
Rippleeffect // drip effect (transition direction not supported)
Pagecurl // page up
Pageuncurl // page flip
Camerairishollowopen // camera lens opening effect (transition direction not supported)
Camerairishollowclose // camera lens close effect (transition direction not supported)
*/

/* Transition direction
Fromright;
Fromleft;
Fromtop;
Frombottom;
*/
Catransition * animation = [catransition animation];
Animation. Delegate = self;
Animation. Duration = 0.5f; // animation duration
Animation. timingfunction = uiviewanimationcurveeaseinout;
Animation. fillmode = kcafillmodeforwards;
Animation. type = @ "cube"; // excessive Effect
Animation. Subtype = @ "formleft"; // transition direction
Animation. startprogress = 0.0 // animation start point (percentage in the overall animation)
Animation. endprogress = 1.0; // animation stop end point (percentage in the overall animation)
Animation. removedoncompletion = no;
[Self. View. layer addanimation: animation forkey: @ "Animation"];

Reference http://www.devdiv.com/home.php? MoD = Space & uid = 8639 & Do = Blog & id = 4143

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.