簡體   English   中英

使用UIIMagepickerController打開相機無法在iPod Touch上快速顯示渲染視圖

[英]Opening camera using UIIMagepickerController not display rendering view on iPod Touch on swift

我正在迅速開發客戶端應用程序。 這是我在swift上的第一個應用程序。 我正在嘗試使用UIImagePickerController從我的應用程序打開相機。 在下面,我添加了我的代碼的快照。 在使用iOS 9.2.1的iPhone 5s和6s上,它可以正常工作。但是,當我嘗試在使用iOS 8.3的iPod Touch上打開時,它具有帶按鈕控件的黑色視圖。 我還附有截屏,它顯示了它的外觀。 請幫助我從中脫穎而出。

碼:

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")
 }

在此處輸入圖片說明

我在我的設備上嘗試了同樣的方法,效果很好。 因此,代碼沒有問題。

現在,我嘗試生成iPod上的問題。 請參閱以下步驟:

  • 轉到設置>選擇您的應用
  • 這樣,您將看到帶有Switch的“照片和相機”選項
  • 如果我在相機中關閉相機電源,則在該應用中使用相機時它將開始顯示黑屏
  • 只需在iPOD設置上檢查一下,然后將其關閉即可。 它將開始工作。

我希望這會指導您。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM