Chapter 27 controlling animations

Source: Internet
Author: User

Chapter 27 controlling animations

 

1. the simplest block-based animation Method on uiview is animatewithduration: Animations :. this method takes in the duration that the animation shocould run for and a block of changes to animate. the animation will follow an increment-in/increment-out animation curve, which will cause the animation to begin slowly, accelerate through the middle, and finally slow down at the end.

 

2. in order to use one of these other timing functions, you will need to use the uiview animation method that allows options to be specified: animatewithduration: delay: Options: Animations: Completion :. this method gives you the most control over the animation. in addition to the duration and animation block, you can also specify how long to delay before the animations shoshould begin, some options (which we will look at shortly ), and a completion block that will get called when the animation sequence completes.

 

3. keyframe animations are set up similarly to basic animations, but each keyframe is added separately. to create a keyframe animation, use the parameter: delay: Options: Animations: Completion: Class Method on uiview, and add keyframes in the animation block using the addkeyframewithrelativestarttime: relativeduration: Animations: class method.

 

4. IOS has a powerful physics engine built into the SDK, and one of the easiest ways to use it is with the new spring animations. this type of animation has a timing function like that of an actual spring. you will use this to animate the text field dropping in from the top of the screen, as if it was attached to a spring, this class method is animatewithduration: delay: usingspringwithdamping: initialspringvelocity: options: Animations: completion.

Chapter 27 controlling animations

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.