gpt4 book ai didi

iphone - iOS 7 中的 UIImagePickerControllerSourceTypePhotoLibrary 无法正常工作

转载 作者:行者123 更新时间:2023-12-03 20:14:16 24 4
gpt4 key购买 nike

当我升级到 iOS7 时,当我从应用程序访问照片库时,我的应用程序显示一个空的 View Controller 。它正在与旧的框架一起使用。

 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];

最佳答案

请直接申请此代码

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

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

谢谢。

关于iphone - iOS 7 中的 UIImagePickerControllerSourceTypePhotoLibrary 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19132197/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com