码迷,mamicode.com
首页 > 其他好文 > 详细

oc 经常用到弹出view的方法

时间:2016-04-01 17:35:58      阅读:161      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!