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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -