Types and implementation methods of iOS animation effects, and ios animation types

Source: Internet
Author: User

Types and implementation methods of iOS animation effects, and ios animation types

There are two main ways to achieve beautiful iOS animation effects,

One is at the UIView level,

One is to use CATransition for lower-level control,

 

The first is UIView. The UIView method may also be encapsulated by CATransition on the lower layer. It can only be used for some simple and common effects. Here, we will write a common sample code, for your reference.

 

[UIView beginAnimations: @ "Curl" context: nil]; // The animation starts [UIView setAnimationDuration: 0.75]; [UIView setAnimationDelegate: self]; [UIView setAnimationTransition: Previous forView: myview cache: YES]; [myview removeFromSuperview]; [UIView commitAnimations];

 

The second method is relatively complicated, but if you want to control it better, use this method,

The following is an example of the basic usage:

 

CATransition * animation = [CATransition animation]; [animation setDuration: 1.25f]; [animation setTimingFunction: [animation encoding: animation]; [animation setType: animation]; [animation setSubtype: kCATransitionFromBottom]; [self. view. layer addAnimation: animation forKey: @ "Reveal"];

The setType and setSubtype combinations are used here, which is relatively safe, because their parameters are defined in the official API. Their parameter descriptions can be referred to below:

 

[Animation setType: @ "suckEffect"];

SuckEffect here is the name of the effect. The following effects can be used:

PageCurl flip one page up pageUnCurl flip one page down rippleEffect drip effect suckEffect shrink effect, such as a piece of cloth is extracted from the cube effect oglFlip flip up and down effect

Finally, a common code is provided for your reference.

// Curl the image up or down CATransition * animation = [CATransition animation]; [animation setDuration: 0.35]; [animation setTimingFunction: UIViewAnimationCurveEaseInOut]; if (! Curled) {// animation. type = @ "mapCurl"; animation. type = @ "pageCurl"; animation. fillMode = kCAFillModeForwards; animation. endProgress = 0.99;} else {// animation. type = @ "mapUnCurl"; animation. type = @ "pageUnCurl"; animation. fillMode = kCAFillModeBackwards; animation. startProgress = 0.01;} [animation setRemovedOnCompletion: NO]; [view exchangeSubviewAtIndex: 0 withSubviewAtIndex: 1]; [view addAnimat Ion: animation forKey "pageCurlAnimation"]; // Disable user interaction where necessary if (! Curled) {} else {} curled =! Curled;
How can I use ios to implement a GUI similar to Baidu audio and video? It is the first time that text fades in and out of animation.

Are you engaged in ios development? Or something else? The transparency of the label can be modified when the text fades in and out, and then the animation can be done. I don't know. What do I mean?

You can use pop in iOS development to create flip pages.

I don't know what kind of effect your paging animation wants.
It can be achieved through Apple's built-in APIs for normal animation effects such as CurlUp.
The main difference between the facebook pop animation engine and Apple's own api is that pop can provide new dynamic effects spring and decay, which can make the visual effect cooler.
You must use pop to implement CurlUp and other effects.
 

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.