3

当我升级到 iOS7 时,当我从应用程序访问照片库时,我的应用程序显示一个空视图控制器。它正在使用较旧的框架。

 UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
    imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    imagePickerController.delegate = self;
    self.imagePicker = imagePickerController;
    //self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    [self presentViewController:self.imagePicker animated:YES completion:nil];
4

1 回答 1

0

请直接申请此代码

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
[self presentViewController:imagePickerController animated:YES completion:nil];

当此代码运行时,“应用程序”想访问您的照片消息,当您单击“确定”时,将显示所有图像

谢谢。

于 2014-02-10T12:36:45.403 回答