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 ...
随机推荐
- picker(拖拽上下拉动的选项)
[b]新版本更新:鼠标上下拖动选择内容:http://hiuman.iteye.com/blog/2353563[/b] (如有错敬请指点,以下是我工作中遇到并且解决的问题) 一开始搜这个内容的时候, ...
- Android AutoCompleteTextView控件实现类似百度搜索提示,限制输入数字长度
Android AutoCompleteTextView 控件实现类似被搜索提示,效果如下 1.首先贴出布局代码 activity_main.xml: <?xml version="1 ...
- javascript原型理解一种
http://www.jianshu.com/p/15ac7393bc1f 这个系列值得好好学习的.. // 声明构造函数 function Person(name, age) { this.name ...
- SpringMVC + Hibernate + MySQL 的简易网页搭建(Dao层 实现篇)
首先在搭建一个网站后台前,需要明确出一个合理的网页搭建的结构框架,即从DB ==> Dao层 ==>Service层 ==>Control层 ==>View层(该层严格意义 ...
- 牛客练习赛16 A 字典序最大的子序列【贪心】
链接:https://www.nowcoder.com/acm/contest/84/A 来源:牛客网 [出处]:http://codeforces.com/contest/196/problem/A ...
- #424 Div2 E
#424 Div2 E 题意 给出一个 n 个数的数列,从前往后取数,如果第一个数是当前数列的最小值,则取出,否则将它放到数列尾端,问使数列为空需要多少步操作. 分析 用数据结构去模拟. 线段树维护区 ...
- (寒假集训) Cow Jog(二分优化的最长上升子数列)
Cow Jog 时间限制: 1 Sec 内存限制: 64 MB提交: 24 解决: 5[提交][状态][讨论版] 题目描述 Farmer John's N cows (1 <= N < ...
- 警告Conversion specifies type'int' but the argument has type'size_t'
代码: #import<Foundation/Foundation.h> int main(int argc,const char * argv[]){ const char *words ...
- JAVA生成问答式验证码图片,支持加减算法
原文:http://liuguihua0823.iteye.com/blog/1511355 import java.awt.Color; import java.awt.Font; import j ...
- 2016summer 训练第二场
1.http://acm.hdu.edu.cn/showproblem.php?pid=5112 #define _CRT_SECURE_NO_DEPRECATE #include<iostre ...