ios8调用相机报警告: Snapshotting a view that has not been rendered results in an empty snapshot. Ensure you
2015-04-01 19:50
344 查看
转载自: http://bbs.yusian.com/thread-10352-1-1.html
我这也报了这个警告,但按他的方法并没有起作用,把写到这个地方看是否其他人用的到错误代码:Snapshotting
a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.问题分析:iOS8在调用系统相机拍照时,会有一两秒的停顿,然后再弹出UIImagePickConroller,IOS7是没有这个问题的,在百度找了无数遍都没能解决这个问题,有说要将imagePickController设置为全局变量,有说要延时0.5秒再presentViewController的,各显神通,但很遗憾的都没能解决这个问题,今天特意单独写个Demo来研究此问题,终于取得了突破性的进展!其实根本原因不在于系统拍照控制器上面,而是执行presentViewController这个动作本身!我们可以查看下UIViewController这个类,他有一个属性[Objective-C] 纯文本查看 复制代码
这是一个枚举值,在iOS7的SDK中,定义如下:[Objective-C] 纯文本查看 复制代码
在iOS8的SDK中定义如下:[Objective-C] 纯文本查看 复制代码
解决问题的关键部分来了,IOS8多了一个样式UIModalPresentationOverCurrentContext,IOS8中presentViewController时请将控制器的modalPresentationStyle设置为UIModalPresentationOverCurrentContext,问题解决!![Objective-C] 纯文本查看 复制代码
我这也报了这个警告,但按他的方法并没有起作用,把写到这个地方看是否其他人用的到错误代码:Snapshotting
a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.问题分析:iOS8在调用系统相机拍照时,会有一两秒的停顿,然后再弹出UIImagePickConroller,IOS7是没有这个问题的,在百度找了无数遍都没能解决这个问题,有说要将imagePickController设置为全局变量,有说要延时0.5秒再presentViewController的,各显神通,但很遗憾的都没能解决这个问题,今天特意单独写个Demo来研究此问题,终于取得了突破性的进展!其实根本原因不在于系统拍照控制器上面,而是执行presentViewController这个动作本身!我们可以查看下UIViewController这个类,他有一个属性[Objective-C] 纯文本查看 复制代码
相关文章推荐
- 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
- ios8调用相机报警告: 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
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- ios下打开相机遇到的闪退问题 (Snapshotting a view that has not been rendered results in an empty snapshot.)
- Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has be
- 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.
- Snapshotting a view that has not been rendered results in an empty snapshot.
- IIS7.0 An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode
- An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
- An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
- Cannot remove an entity that has not been attached
- Sqlachemy的警告SAWarning: The IN-predicate on "sns_object.BIZ_ID" was invoked with an empty sequence. This results in a contradiction, which nonetheless can be expensive to evaluate.
- 解决警告:View.propTypes has been deprecated and will be removed in a future version of ReactNative
- It seems that this file has not been built yet.Do you want to build it now? Codeblocks能构建build不能运run
- Iphone开发中的两个小bug,1.调用camera时的内存警告导致view自动upload,2,Not enough frames in stack.
- 错误 the type "xxxx" is defined in an assembly that is not refernced.You must add a reference to assem
- It seems that this file has not been built yet.Do you want to build it now? Codeblocks能构建build不能运ru