美文网首页
缩放动画

缩放动画

作者: Jieqiudedede | 来源:发表于2014-12-20 10:47 被阅读264次

    -(void)exChangeOut:(UIView *)changeOutView dur:(CFTimeInterval)dur


    {

    CAKeyframeAnimation * animation;

    animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];

    animation.duration = dur;

    //animation.delegate = self;

    animation.removedOnCompletion = NO;

    animation.fillMode = kCAFillModeForwards;

    NSMutableArray *values = [NSMutableArray array];

    [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.2, 0.2, 0.1)]];

    //[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.2, 1.2, 1.0)]];

    //[values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.9, 0.9, 0.9)]];

    [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.5, 0.5, 0.5)]];

    [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];

    animation.values = values;

    animation.timingFunction = [CAMediaTimingFunction functionWithName: @"easeInEaseOut"];

    animation.delegate=self;

    [changeOutView.layer addAnimation:animation forKey:@"animationLayer"];

    }

    相关文章

      网友评论

          本文标题:缩放动画

          本文链接:https://www.haomeiwen.com/subject/kzfgtttx.html