iOS8下,UIImagePickerController的popoverPresentationController为空,要怎么获取?
来源:互联网 发布:mac通过蓝牙传输文件 编辑:程序博客网 时间:2024/06/05 11:08
想popover一个UIImagePickerController,结果发现UIImagePickerController的popoverPresentationController为空,怎么办?
在iOS8中,需要设置UIImagePickerController的modalPresentationStyle,如下:
imagePickerController.modalPresentationStyle = UIModalPresentationPopover;
然后,就可以使用popoverPresentationController了。如下:
UIPopoverPresentationController *popPC = imagePickerController.popoverPresentationController;popPC.sourceView = imageView;popPC.sourceRect = imageView.bounds;[self presentViewController:imagePickerController animated:YES completion:nil];
注意:代码中sourceRect一定要使用bounds,而不能使用frame,不这么用的话,小心弹出的控制器的位置有问题。
0 0
- iOS8下,UIImagePickerController的popoverPresentationController为空,要怎么获取?
- LeTao的popoverPresentationController
- ios8.0 ipad UIImagePickerController
- stringByRemovingPercentEncoding 对空字符对象的转化在ios8以下为nil,ios以上为@“”
- MPMediaItemPropertyAssetURL 属性获取的URL为空
- Content后台的获取为什么为空
- FragmentManager.findFragmentById()获取的fragment为空
- 某些电脑下从注册表中获取的APPdata路径为空(来源于boost问题反馈)
- 控制器的popoverPresentationController的属性到底有啥用?
- Oracle中查询某字段不为空或者为空的SQL语句怎么写
- Oracle中查询某字段不为空或者为空的SQL语句怎么写
- 怎么控制提交的表单项不为空?
- a 标签为空的时候 该怎么写
- 怎么判断CString的类型是否为空
- ListView 数据为空的时候提示怎么写?
- a 标签为空的时候 该怎么写
- iOS8 获取视频缩略图带有时间,怎么获取
- iOS8 获取视频缩略图带有时间,怎么获取
- 用 IntelliJ IDEA 如何像eclipse那样clean项目
- Balanced Binary Tree
- poj3628Bookshelf 2
- 关于eclipse的部分知识
- return str引出的内存分配方式---栈和堆的区别
- iOS8下,UIImagePickerController的popoverPresentationController为空,要怎么获取?
- ASP.NET: The Custom RequestValidator
- CSRFGuard 3 Token Injection
- 关于修饰词const
- 规范化轴的最大最小值 和 间隔
- 笔试题输入一串字符,倒叙单词输出,结尾符号不变
- CentOS 7 64bit系统上编译安装PHP 5.6.13
- Django Template 路径配置
- Apache CXF实战之二 传输pojo对象