zoukankan      html  css  js  c++  java
  • IOS 点击按钮 光环 冲击波效果

    UIBezierPath * path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(00) 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(551)];

        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

  • 相关阅读:
    [SQL SERVER] The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON. (Microsoft SQL Server, Error: 15128)
    CENTOS7 SYSTEMD SERVICE 将自己的程序放入自动启动的系统服务
    CentOS7 关闭selinux
    面试总结TODO
    很好用的 UI 调试技巧
    点满 webpack 技能点,让你的打包速度提效 90%
    前端缓存最佳实践
    Fiddler抓包工具总结
    按钮粒子效果
    如何优雅的在 vue 中添加权限控制
  • 原文地址:https://www.cnblogs.com/rollrock/p/3889426.html
Copyright © 2011-2022 走看看