下面是我如何预取图像
for(i=0; i< data.length; i++) {
if(data[i].question_image) {
let questionImages = [];
questionImages.push(data[i].question_image);
let questionImagesPreFetchTasks = [];
questionImages.forEach((p) => {
questionImagesPreFetchTasks.push(Image.prefetch(p));
Promise.all(questionImagesPreFetchTasks).then(results => {
console.log("All images prefetched in parallel",questionImagesPreFetchTasks);
});
});
}
}