显示半个模态视图的方法
来源:互联网 发布:网络暴力调查问卷 编辑:程序博客网 时间:2024/06/05 19:44
Present a view Controller that is half the size of the screen
up vote4down votefavorite
1
I'm trying to present a view controller thats only half the height using
[self presentModalViewController:menu animated:YES];
The problem is when it's presented, the view controller ends the same size as the screen. I've also tried making the 'menu' the full size of the screen and changing the view's transparency to white but that doesn't work either.
iphone xcode ios
add a comment
3 Answers
activeoldestvotes
up vote7down vote
Just use core animation or animation transitions with a UIView that is half the size of the screen. You'll need a holder view that you add to the main view.
Place the half sized view below the screen (halfView.y = 480 or 320 depending on orientation).
Animate it upwards.
Something like this maybe:
// set up an animation for the transition between the views CATransition *animation = [CATransition animation]; [animation setDuration:0.5]; [animation setType:kCATransitionPush]; [animation setSubtype:kCATransitionFromBottom]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [holderView addAnimation:animation forKey:@"SwitchToView1"];
0 0
- 显示半个模态视图的方法
- 模态视图和父视图之间转换的方法
- 模态视图的概念以及显示、变换方式介绍
- HTML5----CSS显示半个字符
- 一些与视图显示、变换、处理有关的方法
- 视图的全屏显示
- 半个程序员的生存
- 忙碌的半个月
- 忙碌的半个月
- 我的半个寒假
- 模态视图中添加代码的具体方法
- 模态视图的呈现方法及返回
- 全屏显示视图的代码
- 窗体视图的显示效果
- 显示Oracle所有的视图
- powerdesigner 16.5 视图的显示
- MFC程序视图的显示
- 更新视图的方法
- 指针和引用
- iOS UIPageControl
- cocostudio 2.0版本爬坑手记
- 第10周项目1(3)getchar()接受字符数据规律
- 数据结构实验之二叉树的建立于遍历
- 显示半个模态视图的方法
- Linux下安装docker
- 2014年10月份浏览器份IE11晋升第一Web浏览器
- 第十周项目6-贪财的富翁
- Pinterest Copy to China——meterial collect
- 牛人整理分享的面试知识:操作系统、计算机网络、设计模式、Linux编程,数据结构总结
- PKI技术原理(收集 整理 归纳)
- IE中JS跳转丢失referrer问题的2个解决方法
- sdfgsa