ios下打开相机遇到的闪退问题 (Snapshotting a view that has not been rendered results in an empty snapshot.)

来源:互联网 发布:玩客币 知乎 编辑:程序博客网 时间:2024/05/16 09:28

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.



开始以为是这句话 所以一直找关于这句话的 结果找了2个小时 终于知道了ios7的UIImagePickerController是竖屏的 结果游戏是横屏所以一打开就闪退了 


解决方案:

ios文件夹下得AppController

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{

    return UIInterfaceOrientationMaskAll;

}

然后在使用UIImagePickerControllerviewController

- (NSUInteger)supportedInterfaceOrientations{

    return UIInterfaceOrientationMaskLandscape;

}

0 0
原创粉丝点击