使用uibesizerpath
Cashaplayer
画椭圆:

+ (void)drawOvalAnimSourceView:(UIView *)sourceView {

    //view是曲线的背景view

    UIView *view = [[UIView alloc]initWithFrame:sourceView.bounds];

    view.backgroundColor = [UIColor clearColor];
view.transform = CGAffineTransformMakeRotation(-M_PI_2*0.5);
[sourceView addSubview:view]; //第一、UIBezierPath绘制线段 UIBezierPath *firstPath = [UIBezierPath bezierPathWithOvalInRect:sourceView.bounds]; //第二、UIBezierPath和CAShapeLayer关联 CAShapeLayer *lineLayer2 = [CAShapeLayer layer]; lineLayer2.frame = sourceView.bounds; lineLayer2.fillColor = [UIColor clearColor].CGColor; lineLayer2.path = firstPath.CGPath; lineLayer2.strokeColor = [UIColor redColor].CGColor;
lineLayer2.lineWidth = ; //第三,动画 CABasicAnimation *ani = [CABasicAnimation animationWithKeyPath:NSStringFromSelector(@selector(strokeEnd))]; ani.fromValue = @; ani.toValue = @; ani.duration = 2.5; // 2快 3慢 [lineLayer2 addAnimation:ani forKey:NSStringFromSelector(@selector(strokeEnd))]; [view.layer addSublayer:lineLayer2]; UIImageView *hand = [[UIImageView alloc] initWithFrame:CGRectMake(, , , )]; hand.image = [UIImage imageNamed:@"img_help_doubletap_00034"]; [view.layer addSublayer:hand.layer]; UIBezierPath *aniPath = [UIBezierPath bezierPathWithOvalInRect:sourceView.bounds]; CAKeyframeAnimation *animation = [CAKeyframeAnimation animation];
animation.keyPath = @"position";
animation.duration = ;
animation.repeatCount = ;//CGFLOAT_MAX;
animation.path = aniPath.CGPath;
animation.removedOnCompletion = NO;
[hand.layer addAnimation:animation forKey:@"slide"]; }

使用uibesizerpath + Cashaplayer画椭圆的更多相关文章

  1. 《图形学》实验七:中点Bresenham算法画椭圆

    开发环境: VC++6.0,OpenGL 实验内容: 使用中点Bresenham算法画椭圆. 实验结果: 代码: #include <gl/glut.h> #define WIDTH 50 ...

  2. Canvas画椭圆的方法

    虽然标题是画椭圆,但是我们先来说说Canvas中的圆 相信大家对于Canvas画圆都不陌生   oGC.arc(400, 300, 100, 0, 2*Math.PI, false); 如上所示,直接 ...

  3. 利用border-radius画椭圆

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  4. canvas 画椭圆

    圆的标准方程(x-x0)²+(y-y0)²=r²中,有三个参数x0.y0.r,即圆心坐标为(x0, y0), 半径为 r圆的参数方程 x = x0 + r * cosθ, y = y0 + r * s ...

  5. 1.1.4-学习Opencv与MFC混合编程之---画图工具 画椭圆

    源代码地址:http://download.csdn.net/detail/nuptboyzhb/3961690 1.    增加‘椭圆’菜单项,设置属性,添加类向导: 2.    编辑消息处理函数, ...

  6. Bresenham画椭圆算法

    这里不仔细讲原理,只是把我写的算法发出来,跟大家分享下,如果有错误的话,还请大家告诉我,如果写的不好,也请指出来,一起讨论进步. 算法步骤: (1) 输入椭圆的长半轴a和短半轴b. (2) 计算初始值 ...

  7. c++ 珊格画椭圆

    #ifndef _TEST_H #define _TEST_H #include <iostream> #include <math.h> using namespace st ...

  8. Android利用canvas画各种图形(点、直线、弧、圆、椭圆、文字、矩形、多边形、曲线、圆角矩形) .

    1.首先说一下canvas类: Class Overview The Canvas class holds the "draw" calls. To draw something, ...

  9. IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)

    ... 首先了解一下CGContextRef: An opaque type that represents a Quartz 2D drawing environment. Graphics Con ...

随机推荐

  1. 【Spark 深入学习 07】RDD编程之旅基础篇03-键值对RDD

    --------------------- 本节内容: · 键值对RDD出现背景 · 键值对RDD转化操作实例 · 键值对RDD行动操作实例 · 键值对RDD数据分区 · 参考资料 --------- ...

  2. Badboy教程

    Badboy教程 摘自:Badboy-系列教程-资料整理 2016-11-30 1 界面介绍 2 录制 3 创建suites,tests,steps和Template 4 运行脚本 5 参数化 Add ...

  3. 【iCore4 双核心板_FPGA】例程五:基础逻辑门实验——逻辑门使用

    实验现象: 打开tool-->Netlist viewer-->RTL viewer可观察各个逻辑连接 核心代码: //--------------------module_logic_g ...

  4. 【30集iCore3_ADP出厂源代码(ARM部分)讲解视频】30-9底层驱动之USART

    视频简介:该视频介绍iCore3应用开发平台中RTC的基本配置方法以及在应用开发平台中RS-232, RS-485,RS-232的硬件实现方法. 源视频包下载地址:链接:http://pan.baid ...

  5. SQL group BY 合并字段用逗号隔开

    1.关联多表后 根据某个字段作为分组条件,其他合并到新列中,效果如下图 --------> 代码: ),KOrderID) , , '') from VOrder2 tb group by KU ...

  6. 解决Django-1.8.2应用部署到Apache后无法显示admin应用的CSS

    在将Django-1.8.2应用部署到Apache后,无法显示admin应用的静态内容,而在“manage.py runserver”命令下可以正常显示,主要是Apache没有找到Django静态内容 ...

  7. swoole消息推送

    socket.php // 注释的部分是学习的笔记 <?php //创建websocket服务器对象,监听0.0.0.0:9502端口 $ws = ); //监听WebSocket连接打开事件 ...

  8. 工具链接redis

    RedisDesktopManager 链接 文件位置 /usr/loca/redis/etc/redis.conf 一.注释redis.conf文件中的:bind 127.0.0.1(在一段文字之前 ...

  9. linux环境中,如何解压后缀是bz2的压缩包?tar.bz2格式的压缩包,如何进行解压?

    问题说明: 今天下载了一个nagios中文的包,名字nagios-cn-3.2.3.tar.bz2,即以tar.bz2结尾,经常解压tar.gz 突然想不起来这个用什么命令来解压了.百度了下,再次记录 ...

  10. 设计模式-行为型模式,python 中介者模式

    中介者模式 中介者模式(Mediator Pattern)是用来降低多个对象和类之间的通信复杂性.这种模式提供了一个中介类,该类通常处理不同类之间的通信,并支持松耦合,使代码易于维护.中介者模式属于行 ...