Save image in asset catalog on runtime

孤街醉人 提交于 2019-12-19 19:56:27

问题


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.

Any help i been so grateful

Many thanks!


回答1:


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

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

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



来源:https://stackoverflow.com/questions/24949175/save-image-in-asset-catalog-on-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!