Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 动态图像不';t载荷_Javascript_React Native - Fatal编程技术网

Javascript 动态图像不';t载荷

Javascript 动态图像不';t载荷,javascript,react-native,Javascript,React Native,应用程序在index.android.js附近的'./res/'文件夹中使用L |在每次启动时下载图像: 然后我尝试用以下代码加载此图像: <View style={styles.ConferenceVerticalItemImageWrap}> <Image style={[styles.ConferenceVerticalItemImage,{height: height*264/1920, width: height*264/1920}]} resizeM

应用程序在index.android.js附近的
'./res/'
文件夹中使用L |在每次启动时下载图像:

然后我尝试用以下代码加载此图像:

  <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>


图像下载正确,文件夹包含图像,但它们不会显示在屏幕上。

尝试使用绝对URL

e、 g


RNFS.MainBundlePath+“/res/”+图像

以适应您的文件夹。也许你应该使用另一个常数:

顺便说一句,我不知道你是如何下载本地图像的,但是你应该首先让你的下载库给你完整的路径


你能发布更多的代码或者给我们更多关于发生了什么的细节吗?使用这些稀疏的细节很难诊断和解决这样的问题。我添加了更多的信息,我尝试了你的建议,并使用RNFS常量创建了我自己的常量,但它不起作用。
  <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>