有没有办法通过自定义缓动方程使用 UIView 动画

Posted

技术标签:

【中文标题】有没有办法通过自定义缓动方程使用 UIView 动画【英文标题】:Is there a way to use UIView animations with custom ease equation 【发布时间】:2011-02-18 10:08:59 【问题描述】:

UIView 为其动画提供了一些缓动选项(UIViewAnimationOptionCurveEaseInUIViewAnimationOptionCurveEaseOutUIViewAnimationOptionCurveEaseInOut),但我希望对缓动进行更多控制。

有没有办法为其提供自定义方程,或者以任何方式对其进行更多控制?也就是说,除了使用touchesBegan: 等来滚动我自己的动画。

【问题讨论】:

【参考方案1】:

我认为您需要为此使用核心动画。http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html

使用 CAKeyframeAnimation (http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAKeyframeAnimation_class/Introduction/Introduction.html#//apple_ref/occ/cl/CAKeyframeAnimation) 你可以自定义动画的时间

【讨论】:

以上是关于有没有办法通过自定义缓动方程使用 UIView 动画的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 Core Animation 创建自定义缓动功能?

帮助自定义 jquery 缓动功能

自定义动画:缓出

2021-09-25 WPF上位机 44-缓动动画

csharp Robert Penner的缓动方程,来源:http://robertpenner.com/easing/,C#作者:Darren David,原作者保留所有权利

如何构建自定义 jQuery 缓动/弹跳动画?