1. react-native-fetch-blob 将图片存在本地的一个东西react
2. react-native-img-cache 自动缓存的一个东西git
上面装好后 就可使用啦github
import {CachedImage} from "react-native-img-cache";react-native
<CachedImage source={{ uri: "https://i.ytimg.com/vi/yaqe1qesQ8c/maxresdefault.jpg" }} />缓存
若是想让图片有种加载效果fetch
import Image from 'react-native-image-progress';3d
import ProgressBar from 'react-native-progress/Bar';component
最后使用blog
import {CustomCachedImage} from "react-native-img-cache";图片
import Image from 'react-native-image-progress';
import ProgressBar from 'react-native-progress/Bar';
<CustomCachedImage
component={Image}
source={{ uri: 'http://loremflickr.com/640/480/dog' }}
indicator={ProgressBar}
style={{
width: 320,
height: 240,
}}/>
传送门:https://github.com/wcandillon/react-native-img-cache