IOS 点击按钮 光环 冲击波效果
2014-08-04 09:40
302 查看
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
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
相关文章推荐
- android仿IOS按钮点击效果,一张图片实现
- iOS UIPanGestureRecognizer(拖动手势) 和 点击按钮 实现类似左抽屉的效果
- iOS取消按钮点击时的动画效果
- ios按钮点击后翻转效果
- iOS去掉按钮的点击效果
- iOS 点击按钮没有效果解决办法
- iOS开发之--去除按钮的点击效果
- iOS 在tableView上添加button导致按钮没有点击效果和不能滑动的问题
- iOS去掉按钮的点击效果
- iOS取消按钮点击时的动画效果
- IOS 按钮点击发光效果
- android仿IOS按钮点击效果,一张图片实现
- ios 点击按钮,显示遮盖层的效果
- iOS 在tableView上添加button导致按钮没有点击效果和不能滑动的 zhuang
- iOS按钮点击效果消失
- iOS中给自定义tabBar的按钮添加点击放大缩小的动画效果
- iOS并排按钮点击联动效果封装
- IOS 按钮自定义点击效果(UI Color 转换成UI Image)
- iOS开发:多个按钮点击滑动效果
- ios按钮点击后翻转效果