iOS - CABasicAnimation
代码实例:
【1】
- (void)pulseClick { //!> 宽和高等比例转换 CABasicAnimation * pulse = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; pulse.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; pulse.duration = 0.1; //!> 动画持续时间 pulse.repeatCount = ; //!> 动画重复次数 pulse.autoreverses = YES;//!> 动画执行完毕是否自动还原(YES就是自动还原到比例为1的状态) pulse.fromValue = [NSNumber numberWithFloat:]; //!> 动画执行开始的比例 pulse.toValue = [NSNumber numberWithFloat:0.5]; //!> 动画执行终点的比例 [_button.layer addAnimation:pulse forKey:nil]; }
【2】
- (void)pulseClick { CABasicAnimation * pulse = [CABasicAnimation animationWithKeyPath:@"cornerRadius"]; pulse.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; pulse.duration = ; pulse.repeatCount = ; pulse.autoreverses = YES; pulse.fromValue = [NSNumber numberWithFloat:]; pulse.toValue = [NSNumber numberWithFloat:]; [_button.layer addAnimation:pulse forKey:nil]; }
【3】
- (void)pulseClick { CABasicAnimation * pulse = [CABasicAnimation animationWithKeyPath:@"contents"]; pulse.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; pulse.duration = ; pulse.repeatCount = ; pulse.autoreverses = YES; //!> Contents是CALayer的属性,一般就是用作CGImageRef,常见用法就是下面这种用法; pulse.fromValue = (id)[UIImage imageNamed:@"flower"].CGImage; pulse.toValue = (id)[UIImage imageNamed:@"leaf"].CGImage; [_button.layer addAnimation:pulse forKey:nil]; }
【4】
- (void)pulseClick { //!> 一闪一闪的动画效果 CABasicAnimation * pulse = [CABasicAnimation animationWithKeyPath:@"opacity"]; pulse.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; pulse.duration = 0.3; pulse.repeatCount = MAXFLOAT; pulse.fillMode = kCAFillModeForwards; pulse.autoreverses = YES; pulse.fromValue = [NSNumber numberWithFloat:1.0]; pulse.toValue = [NSNumber numberWithFloat:0.2]; [_button.layer addAnimation:pulse forKey:nil]; }
相信iOS客户端开发工程师都对CABasicAnimation都很了解。所以再补充记录一些笔记,关于animationWithKeyPath:
transform.scale = 比例转换
transfrom.scale.x = 宽的比例转换
transfrom.scale.y = 高的比例转换
transfrom.scale.z = 平面圆的旋转(三维z轴)
shadowColor =
shadowOpacity =
shadowRadius =
frame =
bounds =
hidder =
mask =
masksToBounds =
position =
opacity = 透明度
margin =
zPosition =
cornerRadius = 圆角
backgroundColor = 背景颜色
borderWidth = 边框
contents =
contentsRect =
iOS - CABasicAnimation的更多相关文章
- ios之CABasicAnimation
博主:最近iOS开发中用到CoreAnimation的framework来做动画效果,虽然以前也用过,但一直没有系统学习过,今天看到一篇非常详细的博文(虽然是日语,但真的写的很好),在此翻译出来供大家 ...
- iOS开发CABasicAnimation动画理解
1.CALayer简介 CALayer是个与UIView很类似的概念,同样有backgroundColor.frame等相似的属性,我们可以将UIView看做一种特殊的CALayer.但实际上UIVi ...
- IOS第18天(5,CABasicAnimation基本动画)
******* #import "HMViewController.h" @interface HMViewController () @property (nonatomic, ...
- iOS:核心动画之基本动画CABasicAnimation
基本动画,是CAPropertyAnimation的子类 属性说明: fromValue:keyPath相应属性的初始值 toValue:keyPath相应属性的结束值 动画过程说明: 随着动画的进行 ...
- iOS开发——动画编程Swift篇&(四)CABasicAnimation动画
CABasicAnimation动画 //CABasicAnimation-不透明度 @IBAction func cabOpacity() { let animation = CABasicAnim ...
- iOS Layer CABasicAnimation
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- CABasicAnimation 基本动画 分类: ios技术 2015-07-16 17:10 132人阅读 评论(0) 收藏
几个可以用来实现热门APP应用PATH中menu效果的几个方法 +(CABasicAnimation *)opacityForever_Animation:(float)time //永久闪烁的动画 ...
- iOS核心动画详解(CABasicAnimation)
前言 上一篇已经介绍了核心动画在UI渲染中的位置和基本概念,但是没有具体介绍CAAnimation子类的用法,本文将介绍CABasicAnimation及其子类CASpringAnimation的用法 ...
- AJ学IOS(39)UI之核心动画之CABasicAnimation(基础动画)
AJ分享,必须精品 一.CABasicAnimation简介 CAPropertyAnimation的子类 属性解析: fromValue:keyPath相应属性的初始值 toValue:keyPat ...
随机推荐
- 用node.js实现简单的web服务器
node.js实现web服务器还是比较简单的,我了解node.js是从<node入门>开始的,如果你不了解node.js也可以看看! 我根据那书一步一步的练习完了,也的确大概了解了node ...
- NDK开发之javaVM
1.关于JNIEnv和JavaVM JNIEnv是一个与线程相关的变量,不同线程的JNIEnv彼此独立.JavaVM是虚拟机在JNI层的代表,在一个虚拟机进程中只有一个JavaVM,因此该进程的所有线 ...
- 个人觉得目前 最好用的Taobao API的NodeJS封装
话说,Top API SDK默认只给了四种语言的SDK,没有我大NodeJS,这可怎么行,于是封装了一个. 参考地址 GitHub: https://github.com/xiaoppp/TopAPI ...
- 3Dmax 创建物体
扩展基本体-切角长方体: 增加边: 删除边:在边选择模式下, 选择想要删除的边, 按下ctrl+backsapce
- JS 问题集锦
[1]js页面跳转 和 js打开新窗口方法 第一种: <script language="javascript" type="text/javascript&quo ...
- TF-IDF
TF-IDF(term frequency–inverse document frequency)是一种用于资讯检索与文本挖掘的常用加权技术.TF-IDF是一种统计方法,用以评估一字词对于一个文件集或 ...
- SQL Server数据库转换成oracle
来源:http://blog.csdn.net/hzfu007/article/details/6182151 经常碰到需要把sql server的数据迁移到Oracle的情况. 在网上查找一下,有很 ...
- Java反射机制学习与研究
Java反射机制:可以获取正在运行时的Java对象. 1.判断运行时对象对象所属的类. 2.判断运行时对象所具有的成员变量和方法. 3.还可以调用到private方法,改变private变量的值. S ...
- 分布式搜索引擎Elasticsearch PHP类封装 使用原生api
//官方的 php api写的鸡肋了,下面这个类可以使用 es api 操作. <?php class ElasticSearch { public $index; function __co ...
- [转]response.getWriter().write()与out.print()的区别
原文地址:http://blog.csdn.net/javaloveiphone/article/details/8133772 1.首先介绍write()和print()方法的区别: (1).w ...