UIBezierPath * path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(0, 0) radius:ROUND_WIDTH/2 -3 startAngle:0 endAngle:2*M_PI clockwise:YES];

CAShapeLayer * layer = [CAShapeLayer layer];

layer.path = path.CGPath;

layer.fillColor = [[UIColor clearColor]CGColor];

layer.strokeColor = [[UIColor orangeColor] CGColor];

layer.lineCap = kCALineCapRound;

layer.position = pt;

layer.lineWidth = 1.5f;

CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];

scaleAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];

scaleAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(5, 5, 1)];

scaleAnimation.removedOnCompletion = NO;

scaleAnimation.fillMode = kCAFillModeForwards;

CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];

alphaAnimation.fromValue = @1;

alphaAnimation.toValue = @0;

alphaAnimation.removedOnCompletion = NO;

alphaAnimation.fillMode = kCAFillModeForwards;

CAAnimationGroup * group = [CAAnimationGroup animation];

group.animations = @[scaleAnimation, alphaAnimation];

group.duration = 1.5;

group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];

group.delegate = self;

group.removedOnCompletion = NO;

group.fillMode = kCAFillModeForwards;

[_bgImgView.layer addSublayer:layer];

[layer addAnimation:group forKey:@""];

layer = nil;

本文转自  张江论坛  转自请注明~~~~  http://www.999dh.net/home.php?mod=space&uid=1&do=blog&id=409

IOS 点击按钮 光环 冲击波效果的更多相关文章

  1. jquery 实现 点击按钮后倒计时效果,多用于实现发送手机验证码、邮箱验证码

    原文链接:http://www.cnblogs.com/steed-zgf/archive/2012/02/03/2336984.html <!DOCTYPE html PUBLIC " ...

  2. 利用this属性实现点击按钮变色.选中效果

    浏览器宿主的全局环境中,this指的是window对象. <script type="text/javascript"> console.log(this === wi ...

  3. iOS中点击按钮跳转到外部浏览器和内部打开

    如图所示,需要实现点击一个按钮,跳转到指定网页: -(void)pushBtnCellClickDeleate{ NSLog(@"跳转"); //在APP内部打开指定网页 UIWe ...

  4. iOS中点击按钮复制指定内容

    话不多说,直接上图和代码:

  5. iOS - 点击按钮实现简单的复制功能

    UIPasteboard使用 基本使用: - (void)copyClick { UIPasteboard *pab = [UIPasteboard generalPasteboard]; pab.s ...

  6. iOS点击按钮第二次不能旋转View

    原因: 用CGAffineTransformMakeRotation,每次旋转都要在之前最后的角度基础之上再转才有效果. - (void)clickAction: (UIButton *)button ...

  7. 在ios端点击按钮闪烁解决方法(小tips)

    在ios端,safari浏览器上触发click事件有300ms的延迟响应,为touch添加的样式会和click冲突而出现闪烁问题 在safari中触摸事件的相应顺序如下: touchstart --& ...

  8. iOS 点击按钮截屏

    @interface CaptureViewController () @property (nonatomic, strong) UIImageView *backgrounView; //控制器背 ...

  9. 点击按钮切换内容效果(使用CSS DIV与JavaScript)

    <head><script type="text/javascript">function change_div(id){  if (id == 'gsyw ...

随机推荐

  1. *[codility]Fish

    https://codility.com/demo/take-sample-test/fish 一开始习惯性使用单调栈,后来发现一个普通栈就可以了. #include <stack> us ...

  2. [topcoder]BoxesDiv2

    https://community.topcoder.com/stat?c=problem_statement&pm=13192 #include <vector> #includ ...

  3. python 常用数据结构使用

    python 字典操作 http://www.cnblogs.com/kaituorensheng/archive/2013/01/24/2875456.html python 字典排序 http:/ ...

  4. 微信开发之——Php批量生成带参数的二维码

    带参数的二维码对于渠道营销推广来说是很有用的,可以获得多个带不同场景值的二维码,用户扫描后,公众号可以接收到事件推送,可喜的是微信开通了这个接口,那下面就来研究一下吧. 具体接口说明请参见,微信公众平 ...

  5. 46. Permutations

    题目: Given a collection of numbers, return all possible permutations. For example,[1,2,3] have the fo ...

  6. Apache编译与安装 RedHat enterprises 6.2

    引自:http://blog.chinaunix.net/uid-26881541-id-3336614.html http://apr.apache.org/download.cgi 命令: yum ...

  7. Linux下jvm、tomcat、mysql、log4j优化配置

    小菜一直对操作系统心存畏惧,以前也很少接触,这次创业购买了Linux云主机,由于木有人帮忙,只能自己动手优化服务器了.... 小菜的云主机配置大致为:centeos6(32位),4核心cpu,4G内存 ...

  8. (七)CSS定位(Positioning)

    CSS定位属性允许对元素进行定位. 一切皆为框: div.h1或p元素常被称为块级元素,而span和strong等元素成为行内元素,但是可是使用 display 属性改变框的类型,将display设置 ...

  9. BZOJ 2299 向量

    题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2299 题意:给出一对数a,b,任意使用(a,b), (a,-b), (-a,b), (- ...

  10. Regex Failure - Bug Fixing #2

    http://www.codewars.com/kata/55c423ecf847fbcba100002b/train/csharp Oh no, Timmy's received some hate ...