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

下拉弹窗 pop push动画实现

时间:2015-04-03 13:22:54      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

- (void)popTitleView:(UIButton *)btn

{

    if (popView.superview ==self.view) {

        CATransition *animation =[CATransition animation];

        animation.delegate=self;

        animation.duration=0.3;

        animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

        animation.type=kCATransitionPush;

        animation.subtype=kCATransitionFromTop;

        [popView setAlpha:0.0f];

        [popView.layer addAnimation:animation forKey:@"TSLocateView"];

        [popView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0.3];

    }else{

        CATransition *animation =[CATransition animation];

        animation.delegate=self;

        animation.duration=0.3;

        animation.timingFunction=[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

        animation.type=kCATransitionPush;

        animation.subtype=kCATransitionFromBottom;

        [popView setAlpha:1.0f];

        [popView.layer addAnimation:animation forKey:@"pushIn"];

        [self.view addSubview:popView];

    }

}

下拉弹窗 pop push动画实现

标签:

原文地址:http://www.cnblogs.com/baohong-v/p/4389600.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!