gpt4 book ai didi

camera - ios 10 对未渲染的 View 进行快照会生成空快照

转载 作者:行者123 更新时间:2023-12-04 22:57:14 26 4
gpt4 key购买 nike

this question ask again但我没有找到 ios 10

if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera)
{
self.imagePicker.delegate = self
self.imagePicker.sourceType = UIImagePickerControllerSourceType.camera;
self.imagePicker.allowsEditing = false
self.imagePicker.cameraCaptureMode = .photo
//self.imagePicker.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext
self.present(self.imagePicker, animated: true, completion: nil)
self.imagePicked.isUserInteractionEnabled = true

}
else
{
print("No Camera")
}

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.



当我旋转相机并拍摄时,会发生此错误。

最佳答案

自助解决方案像魅力一样为我工作 :-) 希望对所有人都有帮助

DispatchQueue.global(qos: .userInitiated).async
{
self.present(self.imagePicker, animated: true, completion: nil)

}

关于camera - ios 10 对未渲染的 View 进行快照会生成空快照,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40043786/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com