本文主要是介绍CALayer可动画属性,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这些属性用于CAAnimation中的KeyPath设置.
(摘自官方文档, 方便查询.)
表一 CALayer中可以进行动画的属性列表以及它们的默认动画
Property | Default animation |
---|---|
anchorPoint | Uses the default implied CABasicAnimation object, described in Table B-2. |
backgroundColor | Uses the default implied CABasicAnimation object, described in Table B-2. |
backgroundFilters | Uses the default implied CATransition object, described in Table B-3. Sub-properties of the filters are animated using the default implied CABasicAnimation object, described in Table B-2. |
borderColor | Uses the default implied CABasicAnimation object, described in Table B-2. |
borderWidth | Uses the default implied CABasicAnimation object, described in Table B-2. |
bounds | Uses the default implied CABasicAnimation object, described in Table B-2. |
compositingFilter | Uses the default implied CATransition object, described in Table B-3. Sub-properties of the filters are animated using the default implied CABasicAnimation object, described in Table B-2. |
contents | Uses the default implied CABasicAnimation object, described in Table B-2. |
contentsRect | Uses the default implied CABasicAnimation object, described in Table B-2. |
cornerRadius | Uses the default implied CABasicAnimation object, described in Table B-2. |
doubleSided | There is no default implied animation. |
filters | Uses the default implied CABasicAnimation object, described in Table B-2. Sub-properties of the filters are animated using the default implied CABasicAnimation object, described in Table B-2. |
frame | This property is not animatable. You can achieve the same results by animating the bounds and position properties. |
hidden | Uses the default implied CABasicAnimation object, described in Table B-2. |
mask | Uses the default implied CABasicAnimation object, described in Table B-2. |
masksToBounds | Uses the default implied CABasicAnimation object, described in Table B-2. |
opacity | Uses the default implied CABasicAnimation object, described in Table B-2. |
position | Uses the default implied CABasicAnimation object, described in Table B-2. |
shadowColor | Uses the default implied CABasicAnimation object, described in Table B-2. |
shadowOffset | Uses the default implied CABasicAnimation object, described in Table B-2. |
shadowOpacity | Uses the default implied CABasicAnimation object, described in Table B-2. |
shadowPath | Uses the default implied CABasicAnimation object, described in Table B-2. |
shadowRadius | Uses the default implied CABasicAnimation object, described in Table B-2. |
sublayers | Uses the default implied CABasicAnimation object, described in Table B-2. |
sublayerTransform | Uses the default implied CABasicAnimation object, described in Table B-2. |
transform | Uses the default implied CABasicAnimation object, described in Table B-2. |
zPosition | Uses the default implied CABasicAnimation object, described in Table B-2. |
表二: transform属性内的KeyPath
Field Key Path | Description |
---|---|
rotation.x | Set to an NSNumber object whose value is the rotation, in radians, in the x axis. |
rotation.y | Set to an NSNumber object whose value is the rotation, in radians, in the y axis. |
rotation.z | Set to an NSNumber object whose value is the rotation, in radians, in the z axis. |
rotation | Set to an NSNumber object whose value is the rotation, in radians, in the z axis. This field is identical to setting the rotation.z field. |
scale.x | Set to an NSNumber object whose value is the scale factor for the x axis. |
scale.y | Set to an NSNumber object whose value is the scale factor for the y axis. |
scale.z | Set to an NSNumber object whose value is the scale factor for the z axis. |
scale | Set to an NSNumber object whose value is the average of all three scale factors. |
translation.x | Set to an NSNumber object whose value is the translation factor along the x axis. |
translation.y | Set to an NSNumber object whose value is the translation factor along the y axis. |
translation.z | Set to an NSNumber object whose value is the translation factor along the z axis. |
translation | Set to an NSValue object containing an NSSize or CGSize data type. That data type indicates the amount to translate in the x and y axis. |
这篇关于CALayer可动画属性的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!