几个可以用来实现热门APP应用PATH中menu效果的几个方法
+(CABasicAnimation *)opacityForever_Animation:(float)time//永久闪烁的动画
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"opacity"];
animation.fromValue=[NSNumber numberWithFloat:1.0];
animation.toValue=[NSNumber numberWithFloat:0.0];
animation.repeatCount=FLT_MAX;
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
+(CABasicAnimation *)opacityTimes_Animation:(float)repeatTimes durTimes:(float)time;//有闪烁次数的动画
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"opacity"];
animation.fromValue=[NSNumber numberWithFloat:1.0];
animation.toValue=[NSNumber numberWithFloat:0.4];
animation.repeatCount=repeatTimes;
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
+(CABasicAnimation *)moveX:(float)time X:(NSNumber *)x//横向移动
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
+(CABasicAnimation *)moveY:(float)time Y:(NSNumber *)y//纵向移动
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.scale"];
animation.fromValue=orginMultiple;
animation.repeatCount=repeatTimes;
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
CAAnimationGroup *animation=[CAAnimationGroup animation];
animation.animations=animationAry;
animation.repeatCount=repeatTimes;
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
CAKeyframeAnimation *animation=[CAKeyframeAnimation animationWithKeyPath:@"position"];
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
animation.repeatCount=repeatTimes;
+(CABasicAnimation *)movepoint:(CGPoint )point//点移动
CABasicAnimation *animation=[CABasicAnimation animationWithKeyPath:@"transform.translation"];
animation.toValue=[NSValue valueWithCGPoint:point];
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
CATransform3D rotationTransform = CATransform3DMakeRotation(degree, 0, 0,direction);
animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.toValue= [NSValue valueWithCATransform3D:rotationTransform];
animation.removedOnCompletion=NO;
animation.fillMode=kCAFillModeForwards;
animation.repeatCount= repeatCount;
转自:http://blog.youkuaiyun.com/zhuzhihai1988/article/details/8650930
本文介绍了几种使用Core Animation框架实现iOS应用中菜单动画的方法,包括永久闪烁、有次数限制的闪烁、移动、缩放、组合动画、路径动画、点移动及旋转等效果。
2294

被折叠的 条评论
为什么被折叠?



