Swift Animation Programming Guide-02 Introduction to how Swift animation is tempered

Source: Internet
Author: User

We looked at a couple of great examples from the previous section, and we couldn't help but think. How they are designed, how to turn from a blank canvas into a complete, beautiful animation. How these animations are generated and what properties have been changed. What we have to think about is what happens at each step.

Most of the time, we all just manipulate positions, transparency, and scaling to create great animations.

XY coordinate properties (Position)

If we want to move the position of an object on the screen, we only need to change the position property. In the iOS coordinate system, the origin (0.0) is in the upper-left corner. For example, to make an animation that rises from the bottom, just set its y-coordinate at the beginning of the animation to be greater than the resolution of the screen, and then set its y-coordinate in the center of the screen at the end of the animation.

Transparency Properties Opacity

The transparency of an object may be the most common animation, such as fading. The frequency of use is high because of the high degree of convergence with the background when changing. We typically use transparency with animations of other properties. For example, objects rise from the bottom to the center of the screen, with transparency from 0 to 1.

Scaling Properties (Scale)

By adjusting the Zoom property, you can animate the focus of the crowd. For example, we can create a warning box that changes the scale property from 1.3 to 1.0, and then with the transparency change from 0 to 1.

In addition to position, transparency, and scaling, there are three commonly used animation properties: color, angle (rotation), 3D property. We often change the background from one color to another in iOS. Change a button from 0 degrees to 180 degrees, then back to 0 degrees. And 3D flipping is a useful and common animation.

Finally, you are welcome to join the Penguin Group-We all Love Swift (398888638) to communicate together

Swift Animation Programming Guide-02 Introduction to how Swift animation is tempered

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.