IOS各种动画

1。
[html] view plain copy
  1. UIBezierPath *movePath = [UIBezierPath bezierPath];  
  2.    [movePath moveToPoint:center];  
  3.    [movePath addQuadCurveToPoint:toPos  
  4.                     controlPoint:CGPointMake(toPos.x, center.y)];  
  5.      
  6.    CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];  
  7.    moveAnim.path = movePath.CGPath;  
  8.    moveAnim.removedOnCompletion = YES;      
  9.      
  10.    CABasicAnimation *shrink = [CABasicAnimation animationWithKeyPath:@"transform.scale"];  
  11.    shrink.fromValue = [NSNumber numberWithDouble:0.1];  
  12.    shrink.toValue = [NSNumber numberWithDouble:12.0];  
  13.    shrink.fillMode=kCAFillModeForwards;  
  14.    shrink.removedOnCompletion=YES;  
  15.      
  16.    CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];  
  17.    opacityAnim.fromValue = [NSNumber numberWithFloat:1.0];  
  18.    opacityAnim.toValue = [NSNumber numberWithFloat:0.0];  
  19.    opacityAnim.removedOnCompletion = YES;  
  20.      
  21.    CAAnimationGroup *animGroup = [CAAnimationGroup animation];  
  22.    animGroup.animations = [NSArray arrayWithObjects:moveAnim, shrink,opacityAnim, nil];  
  23.    animGroup.duration = 1.0;  
  24.    animGroup.delegate = self;  
  25.    [theLayer addAnimation:animGroup forKey:nil];  

2。
[html] view plain copy
  1. CATransition* animation = [CATransition animation];  
  2. [animation setType:kCATransitionMoveIn];  
  3. [animation setSubtype:kCATransitionFromLeft];  
  4. [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];  
  5. [animation setDuration:1.0f];  
  6. animation.delegate = self;  
  7. [self.preShowLayer addAnimation:animation forKey:@"detailanimated"];  

3。
[html] view plain copy
  1. [UIView beginAnimations:@"enterComment" context:nil];  
  2. [UIView setAnimationDuration:0.3];  
  3. [UIView setAnimationDelegate:self];  
  4.   
  5. sendCommentView.frame = CGRectMake(sendCommentView.frame.origin.x, 480, sendCommentView.frame.size.width, sendCommentView.frame.size.height);  
  6. [UIView commitAnimations];  
4。
[html] view plain copy
  1. [UIView beginAnimations:@"switch321View" context:nil];  
  2. [UIView setAnimationDuration:0.3f];  
  3. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  
  4. //[UIView setAnimationDelegate:self];  
  5. [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.animation321View cache:YES];  
  6. [UIView commitAnimations];  

5。
[html] view plain copy
  1. [UIView beginAnimations:@"switch321View" context:nil];  
  2. [UIView setAnimationDuration:0.3f];  
  3. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  
  4. //[UIView setAnimationDelegate:self];  
  5. [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.animation321View cache:YES];  
  6. [UIView commitAnimations];  
  7. [UIView animateWithDuration:0.3 animations:^{  
  8.     self.functionView.frame = CGRectMake(self.functionView.frame.origin.x, KScrollTableUp, self.functionView.frame.size.width, self.functionView.frame.size.height + (KScrollTableDown - KScrollTableUp));  
  9. } completion:^(BOOL finished) {  
  10.     _animatingWithScrollTable = NO;  
  11. }];  


6.

[html] view plain copy
  1. [UIView transitionWithView: self.view  
  2.                         duration:1.0   
  3.                          options:UIViewAnimationOptionTransitionFlipFromLeft  
  4.                       animations:^{  
  5.                           self.mapView.hidden   = YES;  
  6.                           self.tableView.hidden = NO; }  
  7.                       completion:nil];  


7

[html] view plain copy
  1. [UIView transitionFromView:(displayingPrimary ? primaryView : secondaryView)    
  2.       toView:(displayingPrimary ? secondaryView : primaryView)    
  3.       duration:1.0    
  4.       options:(displayingPrimary ? UIViewAnimationOptionTransitionFlipFromRight :    
  5.                   UIViewAnimationOptionTransitionFlipFromLeft)    
  6.       completion:^(BOOL finished) {    
  7.           if (finished) {    
  8.               displayingPrimary = !displayingPrimary;    
  9.           }    
  10.   }];  

你可能感兴趣的:(html,ios,animation)