CAPropertyAnimation

CAPropertyAnimation详解
本文详细介绍了CAPropertyAnimation类,它是Core Animation框架的一部分,用于创建操纵层属性值的动画。文章涵盖了该类的主要特性,包括如何指定动画的关键路径、确定值的计算行为以及创建动画实例的方法。

CAPropertyAnimation Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/ QuartzCore.framework
Availability
Available in iOS 2.0 and later.
Declared in
CAAnimation.h
Companion guides

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

Property Value Calculation Behavior

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.

@property(getter=isAdditive) BOOL additive
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.

@property(getter=isCumulative) BOOL cumulative
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.

@property(copy) NSString *keyPath
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.

@property(retain) CAValueFunction *valueFunction
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.

+ (id)animationWithKeyPath:( NSString *) keyPath
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.
Related Sample Code
Declared In
CAAnimation.h

转载于:https://www.cnblogs.com/zyingn/articles/iOS_reference2.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值