图像按顺序加载
Images are loaded sequentially
我来了:
<View>
<Image source={{ uri: favicon }} />
<Image
style={iconStyles}
source={require("./a-local-image.png")}
/>
</View>
我的问题是第二张图片是本地图片,直到第一张图片加载后才会显示。我怎样才能让第二个先加载?
一个选项是将第二个 Image
放在第一个上面,这样渲染器将首先渲染它,然后将两个 Images
样式设置到所需的位置。您可以通过在父 View
.
上设置 flexDirection:row-reverse
或 flexDirection:column-reverse
来完成此操作
您确定正在加载您的第二张图片吗,因为它指向 .js 文件作为源。
或者只是解释为什么图像源指向 .js
source={require("./a-local-image.js")}
我来了:
<View>
<Image source={{ uri: favicon }} />
<Image
style={iconStyles}
source={require("./a-local-image.png")}
/>
</View>
我的问题是第二张图片是本地图片,直到第一张图片加载后才会显示。我怎样才能让第二个先加载?
一个选项是将第二个 Image
放在第一个上面,这样渲染器将首先渲染它,然后将两个 Images
样式设置到所需的位置。您可以通过在父 View
.
flexDirection:row-reverse
或 flexDirection:column-reverse
来完成此操作
您确定正在加载您的第二张图片吗,因为它指向 .js 文件作为源。
或者只是解释为什么图像源指向 .js
source={require("./a-local-image.js")}