Animation

1、shake

  
  
  
  
  1. CABasicAnimation *shake = [CABasicAnimation animationWithKeyPath:@"transform"]; 
  2.         shake.duration = 0.13; 
  3.         shake.autoreverses = YES
  4.         shake.repeatCount  = MAXFLOAT
  5.         shake.removedOnCompletion = NO
  6.         shake.fromValue = [NSValue valueWithCATransform3D:CATransform3DRotate(self.layer.transform,-rotation, 0.0 ,0.0 ,1.0)]; 
  7.         shake.toValue   = [NSValue valueWithCATransform3D:CATransform3DRotate(self.layer.transform, rotation, 0.0 ,0.0 ,1.0)]; 
  8.          
  9.         [self.layer addAnimation:shake forKey:@"shakeAnimation"]; 

 

你可能感兴趣的:(移动开发,职场,iPhone,休闲,shake)