首页 > 其他 > 详细

oc 经常用到弹出view的方法

时间:2016-04-01 17:35:39      阅读:199      评论:0      收藏:0      [点我收藏+]

#pragma mark 弹出view

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

{

    CAKeyframeAnimation * animation;

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

    

    animation.duration = dur;

    animation.removedOnCompletion = NO;

    animation.fillMode = kCAFillModeForwards;

    

    NSMutableArray *values = [NSMutableArray array];

    

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

    [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(1.0, 1.0, 1.0)]];

    

    animation.values = values;

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

    

    [changeOutView.layer addAnimation:animation forKey:nil];

}

 

使用:

[self exChangeOut:myview dur:0.5];

oc 经常用到弹出view的方法

原文:http://www.cnblogs.com/Xujg/p/5345453.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!