我有两个场景在我的应用程序(反应-导航)。
场景1:每行图像的平面列表
场景2:相同图像及更多细节
如果我从场景1导航到场景2,组件总是再次加载图像。
为什么图像组件不使用缓存中的图像?在其他组件上(没有导航),缓存正在工作。缓存控制设置为max_age=2592000.
发布于 2017-10-10 10:18:16
如果图像是静态的,则可以从单个文件导入和导出它们:
export default class Images {
static image1 = require("../public/images/image1.jpg");
static image2 = require("../public/images/image2.jpg");
}您可以使用像https://github.com/wcandillon/react-native-static-images这样的工具为您编写脚本。
https://stackoverflow.com/questions/46663806
复制相似问题