presentModalViewController方法,present一个透明的viewController,带动画效果
//假设需要被present的控制器实例为controller,controller的背景色设置为clearColor
UIViewController * rootcontroller = self.view.window.rootViewController;
rootcontroller.modalPresentationStyle = UIModalPresentationCurrentContext;//进入的动画失效
[rootcontroller presentViewController:controller animated:NO completion:^{
rootcontroller.modalPresentationStyle = UIModalPresentationFullScreen;
}];
controller.view.transform = CGAffineTransformMakeTranslation(, controller.view.frame.size.height);
[UIView animateWithDuration:0.35 animations:^{
controller.view.transform = CGAffineTransformMakeTranslation(, );
}];
将其封装成Catrgory后,备用:
- (void) presentTransparentController:(UIViewController *)controller withDuration:(CGFloat) duration { controller.view.backgroundColor = [UIColor clearColor];
controller.view.transform = CGAffineTransformMakeTranslation(, controller.view.frame.size.height);
[UIView animateWithDuration:duration animations:^{
controller.view.transform = CGAffineTransformMakeTranslation(, );
}]; self.modalPresentationStyle = UIModalPresentationCurrentContext;//让进入的动画失效
[self presentViewController:controller animated:NO completion:^{
self.modalPresentationStyle = UIModalPresentationFullScreen;
}];
}
presentModalViewController方法,present一个透明的viewController,带动画效果的更多相关文章
- 一个加载时带动画效果的ListBoxItem
今天我们来谈一下ListBoxItem这个控件,ListBoxItem是直接从ContentControl继承而来的,所以可以添加到任何具有Content属性的控件中去,常见的ListBoxItem可 ...
- 收藏一个带动画效果的ScrollViewer以及ScrollBar的模板
这里介绍一个带动画效果的ScrollViewer和ScrollBar,总共分为两个资源字典,直接拿来引用即可: 1 ScrollBarStyle.xaml <ResourceDictionary ...
- android标题栏上面弹出提示框(二) PopupWindow实现,带动画效果
需求:上次用TextView写了一个从标题栏下面弹出的提示框.android标题栏下面弹出提示框(一) TextView实现,带动画效果, 总在找事情做的产品经理又提出了奇葩的需求.之前在通知栏显示 ...
- android标题栏下面弹出提示框(一) TextView实现,带动画效果
产品经理用的是ios手机,于是android就走上了模仿的道路.做这个东西也走了一些弯路,写一篇博客放在这里,以后自己也可用参考,也方便别人学习. 弯路: 1.刚开始本来用PopupWindow去实现 ...
- 纯CSS3带动画效果导航菜单
随着互联网的发展,网页能表现的东西越来越多.由最开始单纯的文字和链接构成的网页,到后来的表格布局,再到div+css模式,现在发展到了html+css3.网页能表达的东西越来越多,css3兴起已经很多 ...
- Android利用温度传感器实现带动画效果的电子温度计
概述 Android利用温度传感器实现带动画效果的电子温度计. 详细 代码下载:http://www.demodashi.com/demo/10631.html 一.准备工作 需要准备一部带有温度传感 ...
- 我的Android进阶之旅------>Android利用温度传感器实现带动画效果的电子温度计
要想实现带动画效果的电子温度计,需要以下几个知识点: 1.温度传感器相关知识. 2.ScaleAnimation动画相关知识,来进行水印刻度的缩放效果. 3.android:layout_weight ...
- /*带动画效果的hover*/
<!DOCTYPE html> /*带动画效果的hover*/ <html lang="en"> <head> <meta charset ...
- 带动画效果的jQuery手风琴
带动画效果的jQuery特效手风琴是一款带动画效果的手风琴作品,非常实用,可以用在新闻列表.FAQ等模块,默认的是打开第一个选项,查看其它的时候直接点击加号按钮就展开. 源码地址:http://www ...
随机推荐
- iOS开发者证书申请及应用上线发布详解
一个小教程登录开发者中心:http://developer.apple.com/ 第零部分:本地生成密钥1.打开mac的钥匙串访问 2.选择钥匙串的证书助理(有些可能是英文的) 3.点击继续后存 ...
- python--cProfile,memory_profiler,psutil
关于测试代码用了多长时间,我们之前介绍了timeit.相较于timeit,python中还有一个更加强大的模块,cProfile模块 (提到cProfile,其实还有一个profile,但profil ...
- Appium+python自动化1-环境搭建(上)【转载】
前言 appium可以说是做app最火的一个自动化框架,它的主要优势是支持android和ios,另外脚本语言也是支持java和Python.小编擅长Python,所以接下来的教程是appium+py ...
- 有关时间限制使用和软件注册的设计(delphi)
http://blog.sina.com.cn/s/blog_693cf1cf0100oyus.html procedure TForm1.form1create(Sender: TObject);v ...
- 系统封装的dispatch系列代码块引起的循环引用
整整一天的时间都在找内存泄漏,唯独遗漏了这个代码块,结果就是它,希望大家以后注意. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)( ...
- Redis数据类型、两种模型、事务、内部命令
1.redis数据类型 a.字符串,使用场景:常规key-value缓存应用 set name lixiang get name append name 123 # 字符串追加 mset key va ...
- The expression being assigned to optional parameter `v2' must be a constant or default value
今天写代码的时候遇到一个问题以前没有遇到过的问题,就是当我给一个对象参数赋值默认值的时候,报错了,代码如下 public void ShowOrHiddenKuang(bool isShow,Vect ...
- eclipse无法导入Android工程的解决办法
我以前在windows平台下写的android源代码无法通过import"existing project into workspace"导入到mac的eclipse中,直接搜不见 ...
- MVC中的Controller中返回一个JsonResult在弹出一个下载框?
public JsonResult ReturnTest() { return Json(new {myMsg ="hello world"}, "text/html; ...
- sql server 性能调优 资源等待之网络I/O
原文:sql server 性能调优 资源等待之网络I/O 一.概述 与网络I/O相关的等待的主要是ASYNC_NETWORK_IO,是指当sql server返回数据结果集给客户端的时候,会先将结果 ...