为什么照片应用程序未显示在设备上的文档提供程序扩展中?
我正在应用程序中选择照片,我使用UIDocumentMenuViewController
来显示文档提供程序的扩展名列表。 此列表显示Dropbox,iCloud,GoogleDrive但不是原生照片应用,为什么? 我的代码示例:
UIDocumentMenuViewController *menuVC = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport];
我不确定本机是否有其他方法可以做到这一点,但我想出了一个解决方案,用处理程序添加自定义选项。 我添加了“Photos”选项,在处理程序中我使用了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]; }];
我会做同样的事情并为“相机”添加另一个选项。
- 禁用放大WKWebView?
- 更改自定义文本字段背景颜色和文本颜色iOS Swift
- Iphone像素失真,同时缩放Paint应用的OpenGL ES内容
- SpriteKit节点坚持场面/不弹跳
- 在应用程序中存储短audio文件/stream媒体
- iOS后台模式位置更新 – 管理器不在后台模式下更新
- Qt iOS:如何从QVideoFilterRunnable返回types为GLTextureHandle的QVideoFrame
- UITableViewCell中的UIButton
- WatchKit reloadRootControllersWithNames导致错误,与pageController或推/popup后