简体   繁体   English

如何从 Gallery App IOS 内的文档目录显示图像?

[英]How to show Image from document directory inside Gallery App IOS?

I am working in react native and I have downloaded some image from the internet inside the Document directory App folder in IOS.我在 React Native 中工作,我已经从互联网上的 IOS 中的 Document 目录 App 文件夹中下载了一些图像。 Now, I also want this image to show in IOS native Photos/Gallery App.现在,我还希望此图像显示在 IOS 原生照片/图库应用程序中。 Concern:忧虑:

  1. Do I need to make another copy of this image at some other folder to achieve it?我是否需要在其他文件夹中制作此图像的另一个副本才能实现它?
  2. I have also found a method UIImageWriteToSavedPhotosAlbum(), but I failed to understand the usage, Will it create another copy or I need to enable some magic flag kind of thing to work?我还找到了一个方法 UIImageWriteToSavedPhotosAlbum(),但我没能理解它的用法,它会创建另一个副本还是我需要启用某种魔法标志才能工作?

CameraRoll provides access to the local camera roll or photo library. CameraRoll提供对本地相机胶卷或照片库的访问。

CameraRoll.saveToCameraRoll(tag, [type]);

Saves the photo or video to the camera roll or photo library.将照片或视频保存到相机胶卷或照片库。

On Android, the tag must be a local image or video URI, such as "file:///sdcard/img.png".在 Android 上,标签必须是本地图像或视频 URI,例如“file:///sdcard/img.png”。

On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) or a local video file URI (remote or data URIs are not supported for saving video at this time).在 iOS 上,标签可以是任何图像 URI(包括本地、远程资产库和 base64 数据 URI)或本地视频文件 URI(目前不支持远程或数据 URI 来保存视频)。

Note:笔记:

Whenever save image to document directory also need to save that image to CameraRoll / Photolibrary每当将图像保存到文档目录时,也需要将该图像保存到CameraRoll / Photolibrary

React-native camera roll extension to store photos in specific album React-native camera roll扩展以将照片存储在特定相册中

react-native-store-photos-album react-native-store-相册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将最后单击的图像从库保存到ios中的文档目录 - Save last clicked image from gallery to document directory in ios 如何从iOS中的应用程序内的图像库中获取视频 - How to take video from gallery like image inside application in ios 如何在本地HTML中显示保存在文档目录中的图像? 的iOS - How to show an image saved on Documents Directory inside local HTML? iOS 将图像从图库保存到iOS应用 - Saving image from gallery to iOS app 如何使用cordova列出iOS应用程序文档目录中的文件? - How to list files from iOS app document directory using cordova? 如何在 Ionic iOS 中显示图库中的视频 - How to show a video from gallery in Ionic iOS 如何将来自iPhone图库的垂直或垂直图像显示到iOS中的应用程序中? - How to show image as vertical or straight which is coming from iPhone gallery to our application in iOS? 如何在iOS中将文件从文档文件夹复制到相册 - How to copy the file from document folder to photo gallery in ios 将ios从7升级到ios 8时删除了应用程序文档目录数据? - App document directory data removed when upgrade ios from 7 to ios 8? 如何在Document目录中存储图像并将图像路径存储到ios中的数据库中? - How to store Image in Document directory and image path into database in ios?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM