*******

#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
{
CAKeyframeAnimation *anim = [CAKeyframeAnimation animation]; // 设置动画属性
anim.keyPath = @"position"; UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(, , , )]; anim.path = path.CGPath; anim.duration = 0.25; // 取消反弹
anim.removedOnCompletion = NO; anim.fillMode = kCAFillModeForwards; anim.repeatCount = MAXFLOAT; [_redView.layer addAnimation:anim forKey:nil]; }
- (void)value
{
CAKeyframeAnimation *anim = [CAKeyframeAnimation animation]; // 设置动画属性
anim.keyPath = @"position"; NSValue *v1 = [NSValue valueWithCGPoint:CGPointZero]; NSValue *v2 = [NSValue valueWithCGPoint:CGPointMake(, )]; NSValue *v3 = [NSValue valueWithCGPoint:CGPointMake(, )]; anim.values = @[v1,v2,v3]; anim.duration = ; [_redView.layer addAnimation:anim forKey:nil];
} @end

IOS第18天(6,CAKeyframeAnimation关键帧动画)的更多相关文章

  1. core Animation之CAKeyframeAnimation(关键帧动画)

    CABasicAnimation的区别是:CABasicAnimation只能从一个数值(fromValue)变到另一个数值(toValue),而CAKeyframeAnimation会使用一个NSA ...

  2. iOS之CAKeyframeAnimation关键帧动画详解

    CABasicAnimation算是CAKeyFrameAnimation的 特殊情况,即不考虑中间变换过程,只考虑起始点与目标点就可以了.而CAKeyFrameAnimation则更复杂一些,允许我 ...

  3. 之二:CAKeyframeAnimation - 关键帧动画

    是CApropertyAnimation的子类,跟CABasicAnimation的区别是:CABasicAnimation只能从一个数值(fromValue)变到另一个数值(toValue),而CA ...

  4. IOS第18天(5,CABasicAnimation基本动画)

    ******* #import "HMViewController.h" @interface HMViewController () @property (nonatomic, ...

  5. iOS:核心动画之关键帧动画CAKeyframeAnimation

    CAKeyframeAnimation——关键帧动画 关键帧动画,也是CAPropertyAnimation的子类,与CABasicAnimation的区别是: –CABasicAnimation只能 ...

  6. iOS开发UI篇—核心动画(关键帧动画)

    转自:http://www.cnblogs.com/wendingding/p/3801330.html iOS开发UI篇—核心动画(关键帧动画) 一.简单介绍 是CApropertyAnimatio ...

  7. ios基础动画、关键帧动画、动画组、转场动画等

    概览 在iOS中随处都可以看到绚丽的动画效果,实现这些动画的过程并不复杂,今天将带大家一窥iOS动画全貌.在这里你可以看到iOS中如何使用图层精简非交互式绘图,如何通过核心动画创建基础动画.关键帧动画 ...

  8. Swift - 使用CAKeyframeAnimation实现关键帧动画

    1,CAKeyframeAnimation介绍 CAKeyframeAnimation可以实现关键帧动画,这个类可以实现某一属性按照一串的数值进行动画,就像是一帧一帧的制作出来一样.   2,使用样例 ...

  9. iOS基本动画/关键帧动画/利用缓动函数实现物理动画效果

    先说下基本动画部分 基本动画部分比较简单, 但能实现的动画效果也很局限 使用方法大致为: #1. 创建原始UI或者画面 #2. 创建CABasicAnimation实例, 并设置keypart/dur ...

随机推荐

  1. css3 -- 媒体查询

    媒体查询: 1.媒体查询优点:基于设备的属性检测设备,这样一来就不需要使用浏览器探测脚本,之后允许直接安装设备的功能去设定目标样式表,也就是说检测用户使用小屏幕的设备,css规则就会调整以适应该屏幕的 ...

  2. 简单的jQuery扩展函数-让函数缓冲执行

    $.fn.retarder = function(delay, method) { var node = this; if (node.length) { if (node[0]._timer_) c ...

  3. Android自动化测试 - 自动化测试工具比较

  4. Eclipse快捷键/快捷操作汇总

    1.建立.切换不同的工作空间: 工作空间是放置项目的,它是项目的集合,多个工程放在一个工作空间上容易出问题,建议把不同项目存放在单独的工作  空间内,让项目代码更加有序 file → switch w ...

  5. Python连接Oracle

    http://wenku.baidu.com/link?url=2yVoHbJ3XTnZdbyOkN923ncGPqXygJiB6wSRBkqlqimR6H8XxWpBT6GxCTFgmALyqGH0 ...

  6. (转)STORM启动与部署TOPOLOGY

    STORM启动与部署TOPOLOGY 启动ZOOPKEEPER zkServer.sh start 启动NIMBUS storm nimbus & 启动SUPERVISOR storm sup ...

  7. Leetcode Unique Binary Search Trees

    Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp ...

  8. Codeforces Round #251 (Div. 2) A - Devu, the Singer and Churu, the Joker

    水题 #include <iostream> #include <vector> #include <algorithm> using namespace std; ...

  9. [Java] 利用LinkedHashMap来实现LRU Cache

    http://www.acmerblog.com/leetcode-lru-cache-lru-5745.html https://oj.leetcode.com/discuss/1188/java- ...

  10. jQuery AJAX实例

    <html><head><title>jQuery Ajax 实例演示</title></head><script language= ...