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

相关文章

浅析CSS 中z - index属性的作用及在什么情况下会失效

《浅析CSS中z-index属性的作用及在什么情况下会失效》z-index属性用于控制元素的堆叠顺序,值越大,元素越显示在上层,它需要元素具有定位属性(如relative、absolute、fi... 目录1. z-index 属性的作用2. z-index 失效的情况2.1 元素没有定位属性2.2 元素处

HTML5 data-*自定义数据属性的示例代码

《HTML5data-*自定义数据属性的示例代码》HTML5的自定义数据属性(data-*)提供了一种标准化的方法在HTML元素上存储额外信息,可以通过JavaScript访问、修改和在CSS中使用... 目录引言基本概念使用自定义数据属性1. 在 html 中定义2. 通过 JavaScript 访问3.

CSS模拟 html 的 title 属性(鼠标悬浮显示提示文字效果)

《CSS模拟html的title属性(鼠标悬浮显示提示文字效果)》:本文主要介绍了如何使用CSS模拟HTML的title属性,通过鼠标悬浮显示提示文字效果,通过设置`.tipBox`和`.tipBox.tipContent`的样式,实现了提示内容的隐藏和显示,详细内容请阅读本文,希望能对你有所帮助... 效

解读为什么@Autowired在属性上被警告,在setter方法上不被警告问题

《解读为什么@Autowired在属性上被警告,在setter方法上不被警告问题》在Spring开发中,@Autowired注解常用于实现依赖注入,它可以应用于类的属性、构造器或setter方法上,然... 目录1. 为什么 @Autowired 在属性上被警告?1.1 隐式依赖注入1.2 IDE 的警告:

HTML5中下拉框<select>标签的属性和样式详解

《HTML5中下拉框<select>标签的属性和样式详解》在HTML5中,下拉框(select标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中选择值的方式,本文将深入探讨select标签的... 在html5中,下拉框(<select>标签)作为表单的重要组成部分,为用户提供了一个从预定义选项中

在Java中使用ModelMapper简化Shapefile属性转JavaBean实战过程

《在Java中使用ModelMapper简化Shapefile属性转JavaBean实战过程》本文介绍了在Java中使用ModelMapper库简化Shapefile属性转JavaBean的过程,对比... 目录前言一、原始的处理办法1、使用Set方法来转换2、使用构造方法转换二、基于ModelMapper

JavaScript中的isTrusted属性及其应用场景详解

《JavaScript中的isTrusted属性及其应用场景详解》在现代Web开发中,JavaScript是构建交互式应用的核心语言,随着前端技术的不断发展,开发者需要处理越来越多的复杂场景,例如事件... 目录引言一、问题背景二、isTrusted 属性的来源与作用1. isTrusted 的定义2. 为

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

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

最好用的WPF加载动画功能

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

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

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