在 React Native 中更改新 url 时图像不会更改
我正在使用lib react-fast-fast-image
用于显示他的图像。
但是我有一个问题,即我的图像是进入新URL 后不令人耳目一新的问题,我也再次称为SetState。我使用钩子
在下面的链接中增加了时间来修复它:
setImage(ping_push_media + respone + tesne +'?'?' + new date()。getTime()。getTime());
我已经了解到, 图像闪烁每当我在Android上进行测试的状态发生变化时
,但在iOS上似乎也有同样的问题,
我的URL图像是否存在问题?我的图像路径是HTTP不是HTTP,但似乎也对HTTPS不起作用。
我还将缓存模式用作不变的,但是为什么它仍然不起作用呢?
<FastImage
source={{
uri: PING_PUSH_MEDIA + profile?.avatar,
}}
style={styles.itemAvatar}
cache={FastImage.cacheControl.immutable}
/>
请帮我。谢谢!
I'm using lib react-native-fast-image
for the display of his image.
But i'm having a problem that my image is not refreshing after enter new url, I have also called setState again. I use Hook
I have learned that adding time to the link to fix it, below:
setImage(PING_PUSH_MEDIA + respone + '?' + new Date().getTime());
But this results in the image flicker every time the state changes
I'm testing on android, but seems to have the same problem on iOS too
Is there a problem with my url image? My image path is http not https, but it also doesn't seem to work on https.
I also used cache mode as immutable, but why is it still not working?
<FastImage
source={{
uri: PING_PUSH_MEDIA + profile?.avatar,
}}
style={styles.itemAvatar}
cache={FastImage.cacheControl.immutable}
/>
Please, help me. Thanks all !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论