PresentModalViewController显示半透明UIView
来源:互联网 发布:mac草图大师2015破解 编辑:程序博客网 时间:2024/05/21 08:47
很多时候我们需要使用presentModalViewController来显示Modal View。如果需要显示半透明的Modal View应该怎么办呢?当然可以自己创建一个半透明的UIView,然后模拟presentModalViewController的动画效果。
不过iOS 4以后的版本再也不需要怎么麻烦了,有一个非常简单的方法,示例如下(这段代码运行于一个View Controller中):
UIViewController* transparentView = [[UIViewController alloc] init]; UIViewController* controller = self.view.window.rootViewController; transparentView.view.backgroundColor = [UIColor clearColor]; controller.modalPresentationStyle = UIModalPresentationCurrentContext; [controller presentModalViewController:transparentView animated:YES];
其要点就是使用iOS特有的rootViewController来显示Modal View。
- PresentModalViewController显示半透明UIView
- UIView半透明悬浮效果
- presentModalViewController
- 半透明显示图片
- 半透明显示子窗口
- OSG设置半透明显示
- 图片的透明半透明显示!
- OPENGL PNG半透明显示异常
- Modal方式显示UIView
- UIView显示对话
- UIView的显示原理
- UIView显示图片
- #UIView详细显示过程
- UIView中间透明周围半透明(四种方法)
- UIView中间透明周围半透明(四种方法)
- UIView中间透明周围半透明(四种方法)
- UIView裁剪矩形 镂空(中间透明,周围半透明)
- 显示对话框,同时半透明显示背景Activity
- 苹果公司创始人“史蒂夫 · 乔布斯”十大经典格言
- 免费获取欧洲ECMWF两年的天气预报数据:
- Linux系统调用列表
- VC程序查错之内存访问异常
- ASP.net读取Web.xml的配置信息(转自:http://blog.csdn.net/donhao/article/details/6678755)
- PresentModalViewController显示半透明UIView
- <寒江独钓>Windows内核安全编程__键盘过滤之内核级Hook(二)
- 放入多个配置文件时
- 创建离线IPhone Web App
- The pros and "conns" of Intel's ConnMan for Linux
- C语言字节对齐详解
- 在VC++6.0中调试linux的C代码
- 再谈KMP/BM算法(II)
- eclipse Password Required问题解决方法