CAMediaTimingFunction相关

本文详细介绍了iOS中动画时间曲线的使用,包括Linear、Ease-In、Ease-Out、Ease-In Ease-Out四种常见动画效果,并重点讲解如何通过CAMediaTimingFunction自定义动画的时间函数,提供了一个实例代码展示创建自定义动画曲线的方法。
一:Animation Timing Curves

 

1:Linear Animation Timing

 

2:Ease-In Animation Timing

 

3:Ease-Out Animation Timing

 

4:Ease-In Ease-Out Animation Timing

5:Custom Animation Timing

 

自定义动画执行曲线设置

We create a custom timing with the initWithControlPoints:::: method on CAMediaTimingFunction like this:

C代码 收藏代码
  1. - (CAMediaTimingFunction *)getTimingFunction {

  2. CGFloat c1x = 0.5;

  3. CGFloat c1y = 1.0;

  4. CGFloat c2x = 0.5;

  5. CGFloat c2y = 0.0;

  6. return [[CAMediaTimingFunction alloc initWithControlPoints:cx1 :cy1 :cx2 :cy2];

  7. }

 

写道
Since the initial and final values are already known (recall that they are {0, 0} and {1, 1}, respectively), we have to specify only the control
points. In our example, we set the first control point to {0.5, 1.0} and the second control point to {0.5, 0.0}.

 

 

来源:http://o0o0o0o.iteye.com/blog/838547

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值