您的位置:首页 > 移动开发 > IOS开发

iphone ios CABasicAnimation animationWithKeyPath 一些规定的值

2012-02-04 11:33 459 查看
以下大家友情支持一下:
做了一个产品,需要人气支持一下,android和iphone上91市场搜索#super junior粉丝团#,或者直接到页面下载http://m.ixingji.com/m.html?p=X16,大家帮忙捧捧场。

原文:
https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/KVCAdditions.html


Key Path Support for Structure Fields

CAAnimation
provides support for accessing the fields of selected structures using key paths. This is useful for specifying these structure fields as the key paths for animations,
as well as setting and getting values using
setValue:forKeyPath:
and
valueForKeyPath:
.

CATransform3D
exposes the following fields:

Structure Field
Description
rotation.x

The rotation, in radians, in the x axis.
rotation.y

The rotation, in radians, in the y axis.
rotation.z

The rotation, in radians, in the z axis.
rotation

The rotation, in radians, in the z axis. This is identical to setting the
rotation.z
field.
scale.x

Scale factor for the x axis.
scale.y

Scale factor for the y axis.
scale.z

Scale factor for the z axis.
scale

Average of all three scale factors.
translation.x

Translate in the x axis.
translation.y

Translate in the y axis.
translation.z

Translate in the z axis.
translation

Translate in the x and y axis. Value is an NSSize or CGSize.
CGPoint
exposes the following fields:

Structure Field
Description
x

The x component of the point.
y

The y component of the point.
CGSize
exposes the following fields:

Structure Field
Description
width

The width component of the size.
height

The height component of the size.
CGRect
exposes the following fields:

Structure Field
Description
origin

The origin of the rectangle as a
CGPoint
.
origin.x

The x component of the rectangle origin.
origin.y

The y component of the rectangle origin.
size

The size of the rectangle as a
CGSize
.
size.width

The width component of the rectangle size.
size.height

The height component of the rectangle size.
You can not specify a structure field key path using Objective-C 2.0 properties. This will not work:

myLayer.transform.rotation.x=0;

Instead you must use
setValue:forKeyPath:
or
valueForKeyPath:
as
shown below:

[myLayer setValue:[NSNumber numberWithInt:0] forKeyPath:@"transform.rotation.x"];

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: