如何用一些“默认”元素填充 UIImagePicker 的结果?图片(如果用户没有自己的图片可供选择)

发布于 2024-08-28 12:40:12 字数 147 浏览 2 评论 0原文

如何用一些“默认”图像填充 UIImagePickerController 的结果。在本例中,我制作了一个照片处理应用程序,用户可以从他们的库中选择图像,但我想为他们提供示例图像,而不实际将它们保存到他们的库中。有没有办法手动将我的默认图像注入到 UIImagePicker 中?

How does one populate the results of an UIImagePickerController with some "default" images. In this case I have made a photo manipulation app where the user selects an image from their library, but I'd like to give them sample images without actually saving them to their libraries. Is there some way to manually inject my default images in to the the UIImagePicker?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千纸鹤带着心事 2024-09-04 12:40:12

UIImagePickerController 显示相机胶卷中包含的内容。

您是否建议在从相机胶卷中选取图像时,可以有一种方法可以包含捆绑包中的一些图像?因为我不相信情况是这样。使用此功能时,您会看到相机胶卷的副本。

我认为这可行的唯一方法是在加载 UIImagePickerController 之前,将应用程序包中的图像写入相机胶卷。

退出后,从相机胶卷中删除图像,除非选择了该图像。

这样,如果用户愿意,他们可以选择您的图像,如果他们不选择,您可以将其从库中删除。

UIImagePickerController 正在向您显示相机胶卷的表示,因此这是我能想象的唯一可行的方法,并且可能并不理想。

The UIImagePickerController displays what is included in the camera roll.

Are you proposing that there might be a way to also include some images from your bundle when picking from the camera roll? As I do not believe this is the case. You are seeing a copy of the camera roll when using this.

The only way I can see that this will work is that before loading the UIImagePickerController, you write the images from your application bundle to the camera roll.

Upon exiting, delete the images from the camera roll unless it was selected.

This way if they want, the users can select your image and you remove it from the library should they not choose it.

The UIImagePickerController is showing you a representation of the camera roll, so this is the only approach I can imagine would work, and is possibly not ideal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文