简体   繁体   English

使用UIIMagepickerController打开相机无法在iPod Touch上快速显示渲染视图

[英]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: 请参阅以下步骤:

  • Go to settings > Select your App 转到设置>选择您的应用
  • In that you will see Photos & Camera option with Switch 这样,您将看到带有Switch的“照片和相机”选项
  • If i switch off there in camera it will start showing black screen while i use camera in that App 如果我在相机中关闭相机电源,则在该应用中使用相机时它将开始显示黑屏
  • Just check this out on your iPOD settings & if it is off, make it on. 只需在iPOD设置上检查一下,然后将其关闭即可。 It will start working. 它将开始工作。

I hope this will guide you. 我希望这会指导您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用UIImagePickerController使UIView显示摄像机视图 - Make a UIView display the camera view using UIImagePickerController 通过UIImagePickerController使用相机在iPod上崩溃 - Using the camera via UIImagePickerController crashes on iPod UIImagePickerController在打开相机时崩溃 - UIImagePickerController crash on opening camera UIImagePickerController摄像头不能正常工作 - UIImagePickerController camera not working swift Swift:从camera / UIImagePickerController直接查看视图控制器 - Swift: Segue directly to a view controller from camera/UIImagePickerController 如何在 swift 中将相机视图扩展到全屏 - UIImagePickerController - How to expand camera view to full screen in swift - UIImagePickerController Swift 3:在不使用UIImagePickerController的情况下从照片/相机胶卷加载照片 - Swift 3: Load photos from Photos/Camera Roll without using UIImagePickerController UIImagePickerController-在相机上完成关闭(快速) - UIImagePickerController - On Camera Finished Closing (Swift) 在Swift 3中翻译UIImagePickerController相机预览 - Translate UIImagePickerController camera preview in Swift 3 将UIImagePickerController添加为子视图而不是Modal View时,相机滚动不会打开? - camera roll not opening when add UIImagePickerController as a sub view instead of Modal View?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM