博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
下拉弹窗 pop push动画实现
阅读量:6969 次
发布时间:2019-06-27

本文共 986 字,大约阅读时间需要 3 分钟。

- (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];

    }

}

转载于:https://www.cnblogs.com/baohong-v/p/4389600.html

你可能感兴趣的文章
个人知识管理工具 PinPKM
查看>>
Jobs in Codility they're hiring
查看>>
linux下VNC的配置及使用
查看>>
为什么.NET Framework就没有个专门的P/Invoke Library?
查看>>
Silverlight动态设置WCF服务Endpoint
查看>>
lucene对日期(date)和整形(int)处理
查看>>
hdu 4081 次小生成树
查看>>
HtmlNodeType枚举
查看>>
基于TCP的多进程echo服务器
查看>>
ASP.NET页面在IE缓存问题的解决
查看>>
最简单的Epoll模型代码
查看>>
数据结构之字符串
查看>>
blob字段存储文件并读取
查看>>
Process
查看>>
1.1 合用weightSum属性和layout_weight属性
查看>>
linux 查看端口是否被占用
查看>>
Http与协议TCP协议简单易懂
查看>>
使用 JavaScript 实现基本队列、优先队列和循环队列
查看>>
安卓图表引擎AChartEngine(二) - 示例源码概述和分析
查看>>
python模块之imghdr(识别不同格式的图片文件)
查看>>