//假设需要被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,带动画效果的更多相关文章

  1. 一个加载时带动画效果的ListBoxItem

    今天我们来谈一下ListBoxItem这个控件,ListBoxItem是直接从ContentControl继承而来的,所以可以添加到任何具有Content属性的控件中去,常见的ListBoxItem可 ...

  2. 收藏一个带动画效果的ScrollViewer以及ScrollBar的模板

    这里介绍一个带动画效果的ScrollViewer和ScrollBar,总共分为两个资源字典,直接拿来引用即可: 1 ScrollBarStyle.xaml <ResourceDictionary ...

  3. android标题栏上面弹出提示框(二) PopupWindow实现,带动画效果

    需求:上次用TextView写了一个从标题栏下面弹出的提示框.android标题栏下面弹出提示框(一) TextView实现,带动画效果,  总在找事情做的产品经理又提出了奇葩的需求.之前在通知栏显示 ...

  4. android标题栏下面弹出提示框(一) TextView实现,带动画效果

    产品经理用的是ios手机,于是android就走上了模仿的道路.做这个东西也走了一些弯路,写一篇博客放在这里,以后自己也可用参考,也方便别人学习. 弯路: 1.刚开始本来用PopupWindow去实现 ...

  5. 纯CSS3带动画效果导航菜单

    随着互联网的发展,网页能表现的东西越来越多.由最开始单纯的文字和链接构成的网页,到后来的表格布局,再到div+css模式,现在发展到了html+css3.网页能表达的东西越来越多,css3兴起已经很多 ...

  6. Android利用温度传感器实现带动画效果的电子温度计

    概述 Android利用温度传感器实现带动画效果的电子温度计. 详细 代码下载:http://www.demodashi.com/demo/10631.html 一.准备工作 需要准备一部带有温度传感 ...

  7. 我的Android进阶之旅------>Android利用温度传感器实现带动画效果的电子温度计

    要想实现带动画效果的电子温度计,需要以下几个知识点: 1.温度传感器相关知识. 2.ScaleAnimation动画相关知识,来进行水印刻度的缩放效果. 3.android:layout_weight ...

  8. /*带动画效果的hover*/

    <!DOCTYPE html> /*带动画效果的hover*/ <html lang="en"> <head> <meta charset ...

  9. 带动画效果的jQuery手风琴

    带动画效果的jQuery特效手风琴是一款带动画效果的手风琴作品,非常实用,可以用在新闻列表.FAQ等模块,默认的是打开第一个选项,查看其它的时候直接点击加号按钮就展开. 源码地址:http://www ...

随机推荐

  1. 多线程之:java线程创建

    java中创建线程有两种方式: 1.继承Thread类,重写run()方法,如: public class MyThread extends Thread { public void run(){ S ...

  2. 我使用的Sublime插件及配置

    我使用的Sublime插件及配置 增强型插件 Package Control 快捷键ctrl+~,调出命令行,运行: import urllib.request,os,hashlib; h = '29 ...

  3. 使用Sublime Text 3 编写python

    1,下载Sublime Text 3 链接:http://pan.baidu.com/s/1eROBpB0 密码:cqjr 2,安装 注意安装时去掉捆绑的软件安装选项,有两处. 3,安装完成打开软件, ...

  4. MSSQL取得或删除重复数据

    1.取得不重复的数据 select * from Persons where Id in ( SELECT MAX(Id) AS Expr1 FROM Persons GROUP BY Name, G ...

  5. 利用System.Net.Mail 发送邮件

    我这里只是试了一下发mail的功能,感觉.net自带的发mail是比较全的,还是直接上我的code 参数文章:System.Net.Mail 发送邮件 SMTP协议 using System; usi ...

  6. Future使用场景与分析

    前面分享了CountDownLatch的用法,但是由于分享过程中,发现有些朋友,问我Future与CountDownLatch的有什么区别? 答案:只是concurrent包下的并发帮助工具类,两者并 ...

  7. 洛谷——P1469 找筷子

    P1469 找筷子 题目描述 经过一段时间的紧张筹备,电脑小组的“RP餐厅”终于开业了,这天,经理LXC接到了一个定餐大单,可把大家乐坏了!员工们齐心协力按要求准备好了套餐正准备派送时,突然碰到一个棘 ...

  8. Web Api 返回图片流给前端

    public class TestController : ApiController { public HttpResponseMessage GetImg() { //获取文件的绝对路径 stri ...

  9. hdu 1425 Happy 2004

    题目链接 hdu 1425 Happy 2004 题解 题目大意: 求 \[\sum_{d|2004^{x}}d\ mod\ 29\] 记为\(s(2004^x)\) \(sum(2004^{x})= ...

  10. POJ3294 Life Forms(二分+后缀数组)

    给n个字符串,求最长的多于n/2个字符串的公共子串. 依然是二分判定+height分组. 把这n个字符串连接,中间用不同字符隔开,跑后缀数组计算出height: 二分要求的子串长度,判断是否满足:he ...