Types of CATransition transition animation in iOS development

Source: Internet
Author: User

Types of CATransition transition animation in iOS development

Animation is essential during mobile development. With animation, it seems that our program has a life. animation can make our program interface changes smoother, rather than abrupt. today, let's talk about the CATransition transition animation.

Let's take a look at the code implementation of the Transition Animation:

// Create CATransition * transition = [CATransition animation]; transition. duration = 2; // set the transition style/** Types: kCATransitionFade kCATransitionMoveIn kCATransitionPush kCATransitionReveal * // style transition. type = kCATransitionReveal;/*** Subtypes: kCATransitionFromRight; kCATransitionFromLeft; kCATransitionFromTop; kCATransitionFromBottom; * // transition. subtype = kCATransitionFromBottom; // Add an animation [self. changeView. layer addAnimation: transition forKey: nil];

In general, we set the animation type to use the provided enumerated values. By accident, the transition animation can also recognize some strings in OC.

Usage:

transition.type = @"rippleEffect";

The following are some animation types that can be used:

Fade // cross fade transition (transition direction not supported)
Push // The New View pushes the old view out of moveIn // The New View is moved to the old view and reveal // removes the old view, show the following new view cube // cube tumble effect oglFlip // top, bottom, left, and right flip effect suckEffect // contraction effect, such as a piece of cloth being drawn (transition direction not supported) rippleEffect // drip effect (transition direction not supported) pageCurl // page up effect pageUnCurl // page down effect cameraIrisHollowOpen // camera lens opening effect (transition direction not supported) cameraIrisHollowClose // camera lens close effect (transition direction not supported)

Related Article

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.