oc 经常用到弹出view的方法
Posted N4
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oc 经常用到弹出view的方法相关的知识,希望对你有一定的参考价值。
#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的方法的主要内容,如果未能解决你的问题,请参考以下文章