android - 在 react native 上缓存图像
<p><p>是否有一个好的库或者一些默认的 react 原生组件来缓存来自 url 的图像?
我试过<a href="https://github.com/remobile/react-native-cache-image" rel="noreferrer noopener nofollow">react-native-cache-image</a>但是 <a href="https://github.com/johanneslumpe/react-native-fs" rel="noreferrer noopener nofollow">react-native-fs</a> 有很多问题和 react-native-sqlite-storage,因为我是新手,所以我不知道如何正确修复它们。 </p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>yarn add react-native-fast-image</p>
<p>引用:<a href="https://github.com/DylanVann/react-native-fast-image" rel="noreferrer noopener nofollow">https://github.com/DylanVann/react-native-fast-image</a> </p>
<p></p><div class="snippet"data-lang="js"data-hide="false"data-console="true"data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>import FastImage from 'react-native-fast-image'
<FastImage
style={{ width: 200, height: 200 }}
source={{ uri: 'https://unsplash.it/400/400?image=1' }}
resizeMode={FastImage.resizeMode.stretch}
/></code></pre>
<p style="font-size: 20px;">关于android - 在 reactnative 上缓存图像,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/40257712/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/40257712/
</a>
</p>
页:
[1]