[英]Make a UIView display the camera view using UIImagePickerController
[英]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上的問題。 請參閱以下步驟:
我希望這會指導您。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.