我在我的目標C項目中使用了兩個動畫。我似乎沒有得到它使用apportable工作。第一個方法是否會得到支持?CAKeyframeAnimation in Apportable
如果(標籤== 1) { CAKeyframeAnimation *動畫= [CAKeyframeAnimation animationWithKeyPath:@ 「位置」]; animation.duration = 3; animation.removedOnCompletion = YES; animation.fillMode = kCAFillModeForwards; animation.repeatCount = 1; //永遠重複 animation.autoreverses = NO; animation.rotationMode = kCAAnimationRotateAuto; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; animation.calculationMode = kCAAnimationCubic;
UIBezierPath *curvedPath = [UIBezierPath bezierPath]; CGPoint cp; cp.x=100; cp.y=100; [curvedPath moveToPoint:CGPointMake(300,300)]; [curvedPath addLineToPoint:cp]; animation.path=curvedPath.CGPath; animation.delegate=self; //self.alpha=0; [ivcontainer.layer addAnimation:animation forKey:NULL]; } else { ivcontainer.center=CGPointMake(300,300); [UIView beginAnimations:NULL context:NULL]; [UIView setAnimationDuration:3]; [UIView setAnimationRepeatCount:1]; CGPoint cp; cp.x=100; cp.y=100; ivcontainer.center=cp; [UIView commitAnimations]; }
請編輯該問題 – LearnCocos2D