javascript - Dynamic images don't load -
app downloads images @ every start in './res/'
folder near index.android.js using rnfsl|:
var logopath = rnfs.documentdirectorypath+'/res/'; rnfs.downloadfile({ fromurl: host+'logos/'+i.logo, tofile : logopath+i.logo }).catch(function(e){console.log(e)})
and try load image following code:
<view style={styles.conferenceverticalitemimagewrap}> <image style={[styles.conferenceverticalitemimage,{height: height*264/1920, width: height*264/1920}]} resizemode='contain' source={{uri:logopath+this.props.logo}}/> </view>
images downloads correctly , folder contains images don't appear on screen.
try use absolute url instead.
e.g.
rnfs.mainbundlepath + "/res/" + image
to adapted folders. , maybe should use 1 of other constant here: https://github.com/johanneslumpe/react-native-fs#constants
btw, don't know how local image downloaded, should try make downloading library giving full path in first place.
Comments
Post a Comment