在运行时将图像保存在资产目录中 [英] Save image in asset catalog on runtime

查看:155
本文介绍了在运行时将图像保存在资产目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在后台进程中从后端下载新图像,我需要保存它们以便稍后在应用程序中使用。

I have to download new images from backend in background process and i need to save them for use later in the app.

另一方面,原始应用程序图像在资产目录中,当我添加新图像时,必须从资产目录中访问所有图像。

In the other way, the original app images are in the asset catalog and when i add the new ones all images must accessed from the asset catalog.

我尝试将图像添加到目录的应用程序中,但是当我必须加载任何图像时,应用程序不知道区分资产目录中的图像和其他图像不是这个的最佳解决方案

I try to add images to directory's app but when i have to load any image the app do not know to discriminate between images in asset catalog and other, and i thing this is not the best solution for this

我不知道如何在运行时将图像添加到资产目录,或者如果我必须尝试其他方式来支持这一点。

I do not know how add images to asset catalog on runtime or if i have to try other way to support this.

任何帮助我都非常感激

非常感谢!

推荐答案

资产目录是一个资源文件/文件夹,这意味着它放在你的包内。

Asset catalog is a resource file/folder, that means this is placed inside your bundle.

里面的所有文件你的捆绑意味着它不可写。 bundle中的文件只有读权限。

All files inside your bundle means it is not writable. The files inside bundle has only read permissions.

你必须存储在任何一个沙盒文件夹(Documents,Library和temp)中

You have to store in any one of the sandboxed folders (Documents, Library and temp)

这篇关于在运行时将图像保存在资产目录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆