-(CABasicAnimation *)moveX:(float)time X:(NSNumber *)x
{
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];///.y的话就向下移动。
animation.toValue = x;
animation.duration = time;
animation.removedOnCompletion = NO;//yes的话,又返回原位置了。
animation.repeatCount = MAXFLOAT;
animation.fillMode = kCAFillModeForwards;
return animation;
}
网友评论