UIImageView *imageView =[WJDControl createImageViewWithFrame:self.bounds ImageName:@"yuan"];
[self addSubview:imageView];
UIImageView *centerImageView =[WJDControl createImageViewWithFrame:CGRectMake(0, 0, 33, 33) ImageName:@"user_location"];
centerImageView.center = imageView.center;
[self addSubview:centerImageView];
CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
opacityAnimation.fromValue = [NSNumber numberWithFloat:1.0];
opacityAnimation.toValue = [NSNumber numberWithFloat:0.0];
opacityAnimation.duration = 2.0f;
opacityAnimation.autoreverses= NO;
opacityAnimation.repeatCount = MAXFLOAT;
// opacityAnimation.speed = 1.0f;
CABasicAnimation * animation2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
animation2.fromValue = [NSNumber numberWithDouble:0];
animation2.toValue = [NSNumber numberWithDouble:1];
animation2.duration= 2.0;
animation2.autoreverses= NO;
animation2.repeatCount= FLT_MAX; //"forever"
animation2.removedOnCompletion= YES;
[imageView.layer addAnimation:animation2 forKey:@"scale"];
[imageView.layer addAnimation:opacityAnimation forKey:nil];
【IOS】雷达中心扩散效果
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 初步学习了CoreAnimation框架,总结了几个动画效果,主要是通过CAShapeLayer与贝塞尔曲线实现。...
- 安装软件包apt-get install subversion 创建SVN 文件目录svnadmin create...