iphone ios 各种动画

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;  
            }  
    }]; 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值