[英]Opening camera using UIIMagepickerController not display rendering view on iPod Touch on swift
I am working on client app with swift . 我正在迅速开发客户端应用程序。 This is my first app on swift .
这是我在swift上的第一个应用程序。 I am trying to open camera from my app using UIImagePickerController .
我正在尝试使用UIImagePickerController从我的应用程序打开相机。 Below i have added snap of my code .
在下面,我添加了我的代码的快照。 It's working fine on IPhone 5s and 6s with iOS 9.2.1 .But when i am trying to open on iPod Touch with iOS 8.3 it gives black view with button controls.
在使用iOS 9.2.1的iPhone 5s和6s上,它可以正常工作。但是,当我尝试在使用iOS 8.3的iPod Touch上打开时,它具有带按钮控件的黑色视图。 I have attached screen shot also which shows how it looks like.
我还附有截屏,它显示了它的外观。 Please help me to come out from this .
请帮助我从中脱颖而出。
Code: 码:
if UIImagePickerController.isSourceTypeAvailable(.Camera) {
imagePickerViewController = UIImagePickerController()
imagePickerViewController?.delegate = self
imagePickerViewController?.allowsEditing = true
imagePickerViewController?.sourceType = .Camera
imagePickerViewController?.mediaTypes = [kUTTypeImage as String]
imagePickerViewController?.cameraCaptureMode = .Photo
presentViewController(imagePickerViewController!, animated: true, completion: nil)
}
else
{
print("Sorry cant take picture")
}
I tried out the same on my device & it worked fine. 我在我的设备上尝试了同样的方法,效果很好。 So there is no issue with code.
因此,代码没有问题。
Now i tried to generate the issue which you have on iPod. 现在,我尝试生成iPod上的问题。 See this steps:
请参阅以下步骤:
I hope this will guide you. 我希望这会指导您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.