帧动画来回平移

//    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];///.y的话就向下移动。
//    animation.toValue  = @3;
//    animation.duration = 0.3;
//    animation.removedOnCompletion = YES;//yes的话,又返回原位置了。
//    animation.repeatCount = MAXFLOAT;
//    animation.fillMode = kCAFillModeForwards;
//    [sidebtn.layer addAnimation:animation forKey:@"transfore"];

你可能感兴趣的:(帧动画来回平移)