3

我正在應用程序中選擇照片,我使用UIDocumentMenuViewController來顯示文檔提供程序的擴展名列表。此列表顯示Dropbox,iCloud,GoogleDrive但不是本機照片應用程序,爲什麼? 樣品我的代碼:爲什麼照片應用程序未顯示在設備上的文檔提供程序擴展中?

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

enter image description here

+0

首先,你的標題說「現在」,而不是「不」。 – iAdjunct

+0

hehehe對不起:)修正了 –

+0

我假設它也不在「更多...」 – iAdjunct

回答

9

我不知道是否有本地另一種方式來做到這一點,但我想出了一個解決方案,添加自定義選項和處理程序。我補充說:「照片」選項,並在處理程序中我使用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]; 
    }]; 

我將這樣做,並添加另一種選擇「攝像機」。

相關問題