zoukankan      html  css  js  c++  java
  • Chapter 27 Controlling Animations

    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 should run for and a block of changes to animate. The animation will follow an ease-in/ease-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 should 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 animateKeyframesWithDuration: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.

  • 相关阅读:
    vue生命周期过程做了什么
    css_css3_实用属性_随时补充更新
    echarts的symbol引用本地图片写法
    无废话设计模式(1)--简单工厂、工厂方法、抽象工厂
    JavaWeb--Maven学习
    SpringCloud Alibaba实战 -引入服务网关Gateway
    从ReentrantLock看AQS (AbstractQueuedSynchronizer) 运行流程 抽象的队列式同步器
    架构的搭建(一)SpringCloud Alibaba
    配置中心之Nacos简介,使用及Go简单集成
    RabbitMQ
  • 原文地址:https://www.cnblogs.com/1oo1/p/4008278.html
Copyright © 2011-2022 走看看