Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

Loading local image in react native 0.60.3 and Xcode 11

$
0
0

I use react native version 0.60.3. Before one year make an application with local images and it works well. I update Xcode to version 11 and old code and images work well also. I try to add new images for dark mode but the image doesn't show, there isn't an error, only blank space. In code use images from js file like :"url":require("../images/page1.png").

Images are added to copy bundle resources.

I try with command :npx react-native bundle --entry-file='index.ios.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios

and copy assets and main.jsbundle to Xcode and get the same results, before I don't have assets folder in XCode, images are been in copy bundle resources.Old images work (which are added before one year), new images don't work. Did I miss something? I don't have an error and don't know how to fix this issue.

My code:

<CustomImage         width={getImgWidth} height={getImgHeight}         lightpath={it.url}         darkpath={it.urldark}        darkmode={theme.darkmode} />

CustomImage.js

const CustomImage = (props) => {  return (<View style={{ width: props.width, height: props.height }}>  {props.darkmode ? (<Image      resizeMode="contain"      style={{ width: props.width, height: props.height }}      source={props.darkpath}    />     ) : (<Image      resizeMode="contain"      style={{ width: props.width, height: props.height }}      source={props.lightpath}    />  )}</View> ); };

Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>