iphone ios 各种动画

来源:互联网 发布:9wifi九维网络登入网站 编辑:程序博客网 时间:2024/05/20 19:45
1。

 UIBezierPath *movePath = [UIBezierPath bezierPath];    [movePath moveToPoint:center];    [movePath addQuadCurveToPoint:toPos                     controlPoint:CGPointMake(toPos.x, center.y)];        CAKeyframeAnimation *moveAnim = [CAKeyframeAnimation animationWithKeyPath:@"position"];    moveAnim.path = movePath.CGPath;    moveAnim.removedOnCompletion = YES;            CABasicAnimation *shrink = [CABasicAnimation animationWithKeyPath:@"transform.scale"];    shrink.fromValue = [NSNumber numberWithDouble:0.1];    shrink.toValue = [NSNumber numberWithDouble:12.0];    shrink.fillMode=kCAFillModeForwards;    shrink.removedOnCompletion=YES;        CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"opacity"];    opacityAnim.fromValue = [NSNumber numberWithFloat:1.0];    opacityAnim.toValue = [NSNumber numberWithFloat:0.0];    opacityAnim.removedOnCompletion = YES;        CAAnimationGroup *animGroup = [CAAnimationGroup animation];    animGroup.animations = [NSArray arrayWithObjects:moveAnim, shrink,opacityAnim, nil];    animGroup.duration = 1.0;    animGroup.delegate = self;    [theLayer addAnimation:animGroup forKey:nil];

2。

    CATransition* animation = [CATransition animation];    [animation setType:kCATransitionMoveIn];    [animation setSubtype:kCATransitionFromLeft];    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];    [animation setDuration:1.0f];    animation.delegate = self;    [self.preShowLayer addAnimation:animation forKey:@"detailanimated"];

3。

    [UIView beginAnimations:@"enterComment" context:nil];    [UIView setAnimationDuration:0.3];    [UIView setAnimationDelegate:self];        sendCommentView.frame = CGRectMake(sendCommentView.frame.origin.x, 480, sendCommentView.frame.size.width, sendCommentView.frame.size.height);    [UIView commitAnimations];
4。

        [UIView beginAnimations:@"switch321View" context:nil];        [UIView setAnimationDuration:0.3f];        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];        //[UIView setAnimationDelegate:self];        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.animation321View cache:YES];        [UIView commitAnimations];

5。

        [UIView beginAnimations:@"switch321View" context:nil];        [UIView setAnimationDuration:0.3f];        [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];        //[UIView setAnimationDelegate:self];        [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.animation321View cache:YES];        [UIView commitAnimations];        [UIView animateWithDuration:0.3 animations:^{            self.functionView.frame = CGRectMake(self.functionView.frame.origin.x, KScrollTableUp, self.functionView.frame.size.width, self.functionView.frame.size.height + (KScrollTableDown - KScrollTableUp));        } completion:^(BOOL finished) {            _animatingWithScrollTable = NO;        }];


6.

      [UIView transitionWithView: self.view                              duration:1.0                                options:UIViewAnimationOptionTransitionFlipFromLeft                            animations:^{                                self.mapView.hidden   = YES;                                self.tableView.hidden = NO; }                            completion:nil];


7

  [UIView transitionFromView:(displayingPrimary ? primaryView : secondaryView)          toView:(displayingPrimary ? secondaryView : primaryView)          duration:1.0          options:(displayingPrimary ? UIViewAnimationOptionTransitionFlipFromRight :                      UIViewAnimationOptionTransitionFlipFromLeft)          completion:^(BOOL finished) {              if (finished) {                  displayingPrimary = !displayingPrimary;              }      }]; 



原创粉丝点击