UIImagePickerController在iPad上使用iOS(!)9.3.2在iPhone上定位的应用程序上的缩略图问题?

时间:2016-07-05 21:57:41

标签: ipad uiimagepickercontroller

我的应用程序配置为仅使用iPhone设备。在我的应用中,我正在使用UIImagePickerController。在使用iOS 9.3.1的iPhone设备和iPad设备上,照片库的缩略图没有任何问题,但在iOS 9.3.2下的iPad设备上。 任何想法如何解决它而不改变iPhone的目标?#39;到通用'? :) enter image description here

class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
override func viewDidLoad() {
    super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}
@IBAction func touched(sender: AnyObject) {
    if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary) {
        let imagePicker = UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary;
        imagePicker.allowsEditing = false
        self.presentViewController(imagePicker, animated: true, completion: nil)
    }
}
func imagePickerControllerDidCancel(picker: UIImagePickerController) {
    //
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
    //
}

}

1 个答案:

答案 0 :(得分:2)

这个问题似乎来自苹果。在检查您的代码后,似乎一切正常。您可以尝试访问图像选择器的phot0视图,而不是访问相册视图。  尝试使用UIImagePickerControllerSourceTypeSavedPhotosAlbum作为源类型。