为什么照片应用程序未显示在设备上的文档提供程序扩展中?

问题描述:

我正在应用程序中选择照片,我使用UIDocumentMenuViewController来显示文档提供程序的扩展名列表。此列表显示Dropbox,iCloud,GoogleDrive但不是本机照片应用程序,为什么? 样品我的代码:为什么照片应用程序未显示在设备上的文档提供程序扩展中?

UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport]; 

enter image description here

+0

首先,你的标题说“现在”,而不是“不”。 – iAdjunct

+0

hehehe对不起:)修正了 –

+0

我假设它也不在“更多...” – iAdjunct

我不知道是否有本地另一种方式来做到这一点,但我想出了一个解决方案,添加自定义选项和处理程序。我补充说:“照片”选项,并在处理程序中我使用UIImagePickerViewController

UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:UTIs inMode:UIDocumentPickerModeImport]; 


    [menuVC addOptionWithTitle:@"Photos" image:nil order:UIDocumentMenuOrderFirst handler:^{ 

     UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; 

     imagePickerController.delegate = self; 
     [self presentViewController:imagePickerController animated:YES completion:nil]; 
    }]; 

我将这样做,并添加另一种选择“摄像机”。