几个可以用来实现热门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.csdn.net/zhuzhihai1988/article/details/8650930