Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
来源:互联网 发布:化学发展史 知乎 编辑:程序博客网 时间:2024/05/19 21:40
http://bbs.yusian.com/thread-10352-1-1.html 原文地址
问题分析:iOS8在调用系统相机拍照时,会有一两秒的停顿,然后再弹出UIImagePickConroller,IOS7是没有这个问题的,在百度找了无数遍都没能解决这个问题,有说要将imagePickController设置为全局变量,有说要延时0.5秒再presentViewController的,各显神通,但很遗憾的都没能解决这个问题,今天特意单独写个Demo来研究此问题,终于取得了突破性的进展!
其实根本原因不在于系统拍照控制器上面,而是执行presentViewController这个动作本身!我们可以查看下UIViewController这个类,他有一个属性
[Objective-C] 纯文本查看 复制代码
@property
(
nonatomic
,assign) UIModalPresentationStyle modalPresentationStyle
NS_AVAILABLE_IOS
(3_2);
[Objective-C] 纯文本查看 复制代码
typedef
NS_ENUM
(
NSInteger
, UIModalPresentationStyle) {
UIModalPresentationFullScreen = 0,
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
UIModalPresentationPageSheet,
UIModalPresentationFormSheet,
UIModalPresentationCurrentContext,
#endif
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
UIModalPresentationCustom,
UIModalPresentationNone = -1,
#endif
};
[Objective-C] 纯文本查看 复制代码
typedef
NS_ENUM
(
NSInteger
, UIModalPresentationStyle) {
UIModalPresentationFullScreen = 0,
UIModalPresentationPageSheet
NS_ENUM_AVAILABLE_IOS
(3_2),
UIModalPresentationFormSheet
NS_ENUM_AVAILABLE_IOS
(3_2),
UIModalPresentationCurrentContext
NS_ENUM_AVAILABLE_IOS
(3_2),
UIModalPresentationCustom
NS_ENUM_AVAILABLE_IOS
(7_0),
UIModalPresentationOverFullScreen
NS_ENUM_AVAILABLE_IOS
(8_0),
UIModalPresentationOverCurrentContext
NS_ENUM_AVAILABLE_IOS
(8_0),
UIModalPresentationPopover
NS_ENUM_AVAILABLE_IOS
(8_0),
UIModalPresentationNone
NS_ENUM_AVAILABLE_IOS
(7_0) = -1,
};
[Objective-C] 纯文本查看 复制代码
if
([[[UIDevice currentDevice] systemVersion] floatValue]>=8.0) {
self
.modalPresentationStyle=UIModalPresentationOverCurrentContext;
}
0 0
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure you
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure yo
- Snapshotting a view that has not been rendered results in an empty snapshot.
- ios9微信支付报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure yo
- ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot?
- iOS开发打不开相册相机,并报Snapshotting a view that has not been rendered results in an empty snapshot.
- ios下打开相机遇到的闪退问题 (Snapshotting a view that has not been rendered results in an empty snapshot.)
- ios下打开相机遇到的闪退问题 (Snapshotting a view that has not been rendered results in an empty snapshot.)
- "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
- 解决警告:View.propTypes has been deprecated and will be removed in a future version of ReactNative
- 运行spark问题:Initial job has not accepted any resources; check your cluster UI to ensure that workers a
- Finalizing a Cursor that has not been deactivated or closed
- 【BUG】 "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
- Move can only be called on an active agent that has been placed a Navmesh的解决办法
- "SetDestination" can only be called on an active agent that has been placed on a NavMesh. 解决办法
- SharePoint 轻量化应用之HR招聘系统之复试面谈页面设置!
- POJ1182 食物链
- Gradle sync failed: Gradle DSL method not found: 'android()'
- 阿米巴经营的五大目的!
- 影像数据说明整理
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- android studio 初步的dex分包应用
- 图片动态效果
- c
- web 前端,on的使用
- 八数码之 ①暴力BFS+哈希表版 ②双向BFS+输出最佳方案版
- MFC 多语言环境的实现
- Android 图片裁切框架 uCrop 的用法
- aspx 上传文件大小