CAPropertyAnimation
CAPropertyAnimation Class Reference
Overview
CAPropertyAnimation
is an abstract subclass of CAAnimation
for creating animations that manipulate the value of layer properties.
The property is specified using a key path that is relative to the layer
using the animation.
Tasks
Animated Key Path
-
keyPath
property
Property Value Calculation Behavior
-
cumulative
property -
additive
property -
valueFunction
property
Creating an Animation
Properties
additive
Determines if the value specified by the animation is added to the current render tree value to produce the new render tree value.
Discussion
If YES
,
the value specified by the animation will be added to the current
render tree value of the property to produce the new render tree value.
The addition function is type-dependent, e.g. for affine transforms the
two matrices are concatenated. The default is NO
.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.h
cumulative
Determines if the value of the property is the value at the end of the previous repeat cycle, plus the value of the current repeat cycle.
Discussion
If YES
,
then the value of the property is the value at the end of the previous
repeat cycle, plus the value of the current repeat cycle. If NO
, the value of the property is simply the value calculated for the current repeat cycle. The default is NO
.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.h
keyPath
Specifies the key path the receiver animates.
Discussion
The key path is relative to the layer the receiver is attached to.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.h
valueFunction
An optional value function that is applied to interpolated values.
Discussion
If the valueFunction
property is not nil
,
the function is applied to the values interpolated by the animation as
they are applied to the presentation layer. Defaults to nil
.
Availability
- Available in iOS 3.0 and later.
Declared In
CAAnimation.h
Class Methods
animationWithKeyPath:
Creates and returns an CAPropertyAnimation
instance for the specified key path.
Parameters
- keyPath
-
The key path of the property to be animated.
Return Value
A new instance of CAPropertyAnimation
with the key path set to keyPath.
Availability
- Available in iOS 2.0 and later.
Declared In
CAAnimation.h
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 后端思维之高并发处理方案
· 理解Rust引用及其生命周期标识(下)
· 从二进制到误差:逐行拆解C语言浮点运算中的4008175468544之谜
· .NET制作智能桌面机器人:结合BotSharp智能体框架开发语音交互
· 软件产品开发中常见的10个问题及处理方法
· 后端思维之高并发处理方案
· 千万级大表的优化技巧
· 在 VS Code 中,一键安装 MCP Server!
· 想让你多爱自己一些的开源计时器
· 10年+ .NET Coder 心语 ── 继承的思维:从思维模式到架构设计的深度解析