CALayer可动画属性

2023-12-09 00:18
文章标签 属性 动画 calayer

本文主要是介绍CALayer可动画属性,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

这些属性用于CAAnimation中的KeyPath设置.
(摘自官方文档, 方便查询.)

表一 CALayer中可以进行动画的属性列表以及它们的默认动画
PropertyDefault animation
anchorPointUses the default implied CABasicAnimation object, described in Table B-2.
backgroundColorUses the default implied CABasicAnimation object, described in Table B-2.
backgroundFiltersUses 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.
borderColorUses the default implied CABasicAnimation object, described in Table B-2.
borderWidthUses the default implied CABasicAnimation object, described in Table B-2.
boundsUses the default implied CABasicAnimation object, described in Table B-2.
compositingFilterUses 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.
contentsUses the default implied CABasicAnimation object, described in Table B-2.
contentsRectUses the default implied CABasicAnimation object, described in Table B-2.
cornerRadiusUses the default implied CABasicAnimation object, described in Table B-2.
doubleSidedThere is no default implied animation.
filtersUses 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.
frameThis property is not animatable. You can achieve the same results by animating the bounds and position properties.
hiddenUses the default implied CABasicAnimation object, described in Table B-2.
maskUses the default implied CABasicAnimation object, described in Table B-2.
masksToBoundsUses the default implied CABasicAnimation object, described in Table B-2.
opacityUses the default implied CABasicAnimation object, described in Table B-2.
positionUses the default implied CABasicAnimation object, described in Table B-2.
shadowColorUses the default implied CABasicAnimation object, described in Table B-2.
shadowOffsetUses the default implied CABasicAnimation object, described in Table B-2.
shadowOpacityUses the default implied CABasicAnimation object, described in Table B-2.
shadowPathUses the default implied CABasicAnimation object, described in Table B-2.
shadowRadiusUses the default implied CABasicAnimation object, described in Table B-2.
sublayersUses the default implied CABasicAnimation object, described in Table B-2.
sublayerTransformUses the default implied CABasicAnimation object, described in Table B-2.
transformUses the default implied CABasicAnimation object, described in Table B-2.
zPositionUses the default implied CABasicAnimation object, described in Table B-2.
表二: transform属性内的KeyPath
Field Key PathDescription
rotation.xSet to an NSNumber object whose value is the rotation, in radians, in the x axis.
rotation.ySet to an NSNumber object whose value is the rotation, in radians, in the y axis.
rotation.zSet to an NSNumber object whose value is the rotation, in radians, in the z axis.
rotationSet 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.xSet to an NSNumber object whose value is the scale factor for the x axis.
scale.ySet to an NSNumber object whose value is the scale factor for the y axis.
scale.zSet to an NSNumber object whose value is the scale factor for the z axis.
scaleSet to an NSNumber object whose value is the average of all three scale factors.
translation.xSet to an NSNumber object whose value is the translation factor along the x axis.
translation.ySet to an NSNumber object whose value is the translation factor along the y axis.
translation.zSet to an NSNumber object whose value is the translation factor along the z axis.
translationSet 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可动画属性的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/471808

相关文章

Java如何通过反射机制获取数据类对象的属性及方法

《Java如何通过反射机制获取数据类对象的属性及方法》文章介绍了如何使用Java反射机制获取类对象的所有属性及其对应的get、set方法,以及如何通过反射机制实现类对象的实例化,感兴趣的朋友跟随小编一... 目录一、通过反射机制获取类对象的所有属性以及相应的get、set方法1.遍历类对象的所有属性2.获取

最好用的WPF加载动画功能

《最好用的WPF加载动画功能》当开发应用程序时,提供良好的用户体验(UX)是至关重要的,加载动画作为一种有效的沟通工具,它不仅能告知用户系统正在工作,还能够通过视觉上的吸引力来增强整体用户体验,本文给... 目录前言需求分析高级用法综合案例总结最后前言当开发应用程序时,提供良好的用户体验(UX)是至关重要

基于Python实现PDF动画翻页效果的阅读器

《基于Python实现PDF动画翻页效果的阅读器》在这篇博客中,我们将深入分析一个基于wxPython实现的PDF阅读器程序,该程序支持加载PDF文件并显示页面内容,同时支持页面切换动画效果,文中有详... 目录全部代码代码结构初始化 UI 界面加载 PDF 文件显示 PDF 页面页面切换动画运行效果总结主

vue如何监听对象或者数组某个属性的变化详解

《vue如何监听对象或者数组某个属性的变化详解》这篇文章主要给大家介绍了关于vue如何监听对象或者数组某个属性的变化,在Vue.js中可以通过watch监听属性变化并动态修改其他属性的值,watch通... 目录前言用watch监听深度监听使用计算属性watch和计算属性的区别在vue 3中使用watchE

Qt QWidget实现图片旋转动画

《QtQWidget实现图片旋转动画》这篇文章主要为大家详细介绍了如何使用了Qt和QWidget实现图片旋转动画效果,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 一、效果展示二、源码分享本例程通过QGraphicsView实现svg格式图片旋转。.hpjavascript

【前端学习】AntV G6-08 深入图形与图形分组、自定义节点、节点动画(下)

【课程链接】 AntV G6:深入图形与图形分组、自定义节点、节点动画(下)_哔哩哔哩_bilibili 本章十吾老师讲解了一个复杂的自定义节点中,应该怎样去计算和绘制图形,如何给一个图形制作不间断的动画,以及在鼠标事件之后产生动画。(有点难,需要好好理解) <!DOCTYPE html><html><head><meta charset="UTF-8"><title>06

滚雪球学Java(87):Java事务处理:JDBC的ACID属性与实战技巧!真有两下子!

咦咦咦,各位小可爱,我是你们的好伙伴——bug菌,今天又来给大家普及Java SE啦,别躲起来啊,听我讲干货还不快点赞,赞多了我就有动力讲得更嗨啦!所以呀,养成先点赞后阅读的好习惯,别被干货淹没了哦~ 🏆本文收录于「滚雪球学Java」专栏,专业攻坚指数级提升,助你一臂之力,带你早日登顶🚀,欢迎大家关注&&收藏!持续更新中,up!up!up!! 环境说明:Windows 10

Flutter 进阶:绘制加载动画

绘制加载动画:由小圆组成的大圆 1. 定义 LoadingScreen 类2. 实现 _LoadingScreenState 类3. 定义 LoadingPainter 类4. 总结 实现加载动画 我们需要定义两个类:LoadingScreen 和 LoadingPainter。LoadingScreen 负责控制动画的状态,而 LoadingPainter 则负责绘制动画。

用Unity2D制作一个人物,实现移动、跳起、人物静止和动起来时的动画:中(人物移动、跳起、静止动作)

上回我们学到创建一个地形和一个人物,今天我们实现一下人物实现移动和跳起,依次点击,我们准备创建一个C#文件 创建好我们点击进去,就会跳转到我们的Vision Studio,然后输入这些代码 using UnityEngine;public class Move : MonoBehaviour // 定义一个名为Move的类,继承自MonoBehaviour{private Rigidbo

HTML5自定义属性对象Dataset

原文转自HTML5自定义属性对象Dataset简介 一、html5 自定义属性介绍 之前翻译的“你必须知道的28个HTML5特征、窍门和技术”一文中对于HTML5中自定义合法属性data-已经做过些介绍,就是在HTML5中我们可以使用data-前缀设置我们需要的自定义属性,来进行一些数据的存放,例如我们要在一个文字按钮上存放相对应的id: <a href="javascript:" d