IOS第18天(9,核心动画-动画组)
****动画组
// 核心动画都是假象,不能改变layer的真实属性的值
// 展示的位置和实际的位置不同。实际位置永远在最开始位置
#import "HMViewController.h" @interface HMViewController ()
@property (weak, nonatomic) IBOutlet UIView *redView; @end @implementation HMViewController - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
} - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{ CABasicAnimation *rotation = [CABasicAnimation animation]; rotation.keyPath = @"transform.rotation"; rotation.toValue = @M_PI_2; CABasicAnimation *position = [CABasicAnimation animation]; position.keyPath = @"position"; position.toValue = [NSValue valueWithCGPoint:CGPointMake(, )];
CABasicAnimation *scale = [CABasicAnimation animation];
scale.keyPath = @"transform.scale";
scale.toValue = @0.5;
CAAnimationGroup *group = [CAAnimationGroup animation]; group.animations = @[rotation,position,scale]; group.duration = ; // 取消反弹
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards; [_redView.layer addAnimation:group forKey:nil];
} @end
IOS第18天(9,核心动画-动画组)的更多相关文章
- IOS第18天(1,核心动画layer, 旋转,缩放,平移,边框,剪裁,圆角)
****动画效果 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [UIView animateWithDurat ...
- IOS第18天(10,核心动画-转盘,自定义buton,旋转动画)
*****HMViewController.m #import "HMViewController.h" #import "HMWheelView.h" @in ...
- IOS第18天(8,核心动画转场动画)
***翻页效果 #import "HMViewController.h" @interface HMViewController () @property (weak, nonat ...
- IOS第18天(4,核心动画,时钟效果,定时器,图片旋转角度,CALayer 锚点,获取当前,小时,秒,分)
**** #import "HMViewController.h" // 每秒秒针转6度 #define perSecendA 6 // 每分钟分针转6度 #define perM ...
- IOS第18天(6,CAKeyframeAnimation关键帧动画)
******* #import "HMViewController.h" @interface HMViewController () @property (weak, nonat ...
- IOS第18天(5,CABasicAnimation基本动画)
******* #import "HMViewController.h" @interface HMViewController () @property (nonatomic, ...
- iOS开发UI篇—核心动画(转场动画和组动画)
转自:http://www.cnblogs.com/wendingding/p/3801454.html iOS开发UI篇—核心动画(转场动画和组动画) 一.转场动画简单介绍 CAAnimation的 ...
- 荼菜的iOS笔记--UIView的几个Block动画
前言:我的第一篇文章荼菜的iOS笔记–Core Animation 核心动画算是比较详细讲了核心动画的用法,但是如你上篇看到的,有时我们只是想实现一些很小的动画,这时再用coreAnimation就会 ...
- 李洪强iOS经典面试题143-绘图与动画
李洪强iOS经典面试题143-绘图与动画 绘图与动画 CAAnimation的层级结构 CAPropertyAnimation是CAAnimation的子类,也是个抽象类,要想创建动画对象,应该使 ...
随机推荐
- shell-bash学习02运算、拼接、重定向
运算 let操作 可以直接执行基本的算术操作;使用时,变量名之前不需要再添加$; #!/bin/bash no1=4; no2=5; let result=no1+no2 echo $result 自 ...
- Uva12206 Stammering Aliens 后缀数组&&Hash
Dr. Ellie Arroway has established contact with an extraterrestrial civilization. However, all effort ...
- vs2008/2010安装无法打开数据文件解决方案
本人在安装VS2008或2010时,在开始的第一个页面(进度条大约加载到75%左右),提示“无法打开数据文件 'C:/Documents and Settings/Administrator/Loca ...
- FString的相关文档,另外还有4种LOG的方法
https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/StringHandling/FString/index ...
- CF# Educational Codeforces Round 3 E. Minimum spanning tree for each edge
E. Minimum spanning tree for each edge time limit per test 2 seconds memory limit per test 256 megab ...
- 【Linux程序设计】之进程控制&守护进程
这个系列的博客贴的都是我大二的时候学习Linux系统高级编程时的一些实验程序,都挺简单的. 实验题目:Linux环境下的进程控制 实验目的:熟悉并掌握Linux环境下进程的相关函数的应用:守护进程的概 ...
- BZOJ2769 : YY的快速排序
将数字离散化并去重,则对于一对逆序对$i<j$,$a_i>a_j$,贡献为$\frac{2}{a_i-a_j+1}$,因此只要对于每个差值统计出对应的逆序对个数即可. 将序列分块,块内平方 ...
- float使内联支持宽高
float使内联元素支持了宽高,可以设置宽高属性:float消除内联元素的空格:
- Topcoder SRM 626 DIV2 SumOfPower
本题就是求所有连续子数列的和 开始拿到题目还以为求的时数列子集的和,认真看到题目才知道是连续子数列 循环遍历即可 int findSum(vector <int> array) { ; ; ...
- objective-c 多线程注意的问题
1.资源竞争:当每个线程都去访问同一段内存时,会导致所谓i资源竞争问题,这时候可以通过“@synchronized block”将实例变量包围起来,创建一个互斥锁, 这样你就可以确保在互斥锁中的代码一 ...