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

相关文章

Python如何调用另一个类的方法和属性

《Python如何调用另一个类的方法和属性》在Python面向对象编程中,类与类之间的交互是非常常见的场景,本文将详细介绍在Python中一个类如何调用另一个类的方法和属性,大家可以根据需要进行选择... 目录一、前言二、基本调用方式通过实例化调用通过类继承调用三、高级调用方式通过组合方式调用通过类方法/静

spring中的@MapperScan注解属性解析

《spring中的@MapperScan注解属性解析》@MapperScan是Spring集成MyBatis时自动扫描Mapper接口的注解,简化配置并支持多数据源,通过属性控制扫描路径和过滤条件,利... 目录一、核心功能与作用二、注解属性解析三、底层实现原理四、使用场景与最佳实践五、注意事项与常见问题六

Linux线程之线程的创建、属性、回收、退出、取消方式

《Linux线程之线程的创建、属性、回收、退出、取消方式》文章总结了线程管理核心知识:线程号唯一、创建方式、属性设置(如分离状态与栈大小)、回收机制(join/detach)、退出方法(返回/pthr... 目录1. 线程号2. 线程的创建3. 线程属性4. 线程的回收5. 线程的退出6. 线程的取消7.

python删除xml中的w:ascii属性的步骤

《python删除xml中的w:ascii属性的步骤》使用xml.etree.ElementTree删除WordXML中w:ascii属性,需注册命名空间并定位rFonts元素,通过del操作删除属... 可以使用python的XML.etree.ElementTree模块通过以下步骤删除XML中的w:as

Python打印对象所有属性和值的方法小结

《Python打印对象所有属性和值的方法小结》在Python开发过程中,调试代码时经常需要查看对象的当前状态,也就是对象的所有属性和对应的值,然而,Python并没有像PHP的print_r那样直接提... 目录python中打印对象所有属性和值的方法实现步骤1. 使用vars()和pprint()2. 使

CSS3中的字体及相关属性详解

《CSS3中的字体及相关属性详解》:本文主要介绍了CSS3中的字体及相关属性,详细内容请阅读本文,希望能对你有所帮助... 字体网页字体的三个来源:用户机器上安装的字体,放心使用。保存在第三方网站上的字体,例如Typekit和Google,可以link标签链接到你的页面上。保存在你自己Web服务器上的字

SpringBoot读取ZooKeeper(ZK)属性的方法实现

《SpringBoot读取ZooKeeper(ZK)属性的方法实现》本文主要介绍了SpringBoot读取ZooKeeper(ZK)属性的方法实现,强调使用@ConfigurationProperti... 目录1. 在配置文件中定义 ZK 属性application.propertiesapplicati

Java反射实现多属性去重与分组功能

《Java反射实现多属性去重与分组功能》在Java开发中,​​List是一种非常常用的数据结构,通常我们会遇到这样的问题:如何处理​​List​​​中的相同字段?无论是去重还是分组,合理的操作可以提高... 目录一、开发环境与基础组件准备1.环境配置:2. 代码结构说明:二、基础反射工具:BeanUtils

MySQL 事务的概念及ACID属性和使用详解

《MySQL事务的概念及ACID属性和使用详解》MySQL通过多线程实现存储工作,因此在并发访问场景中,事务确保了数据操作的一致性和可靠性,下面通过本文给大家介绍MySQL事务的概念及ACID属性和... 目录一、什么是事务二、事务的属性及使用2.1 事务的 ACID 属性2.2 为什么存在事务2.3 事务

Kotlin Compose Button 实现长按监听并实现动画效果(完整代码)

《KotlinComposeButton实现长按监听并实现动画效果(完整代码)》想要实现长按按钮开始录音,松开发送的功能,因此为了实现这些功能就需要自己写一个Button来解决问题,下面小编给大... 目录Button 实现原理1. Surface 的作用(关键)2. InteractionSource3.