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

react native image from filesystem not displaying in ios

$
0
0

The react native image does not appear but takes up space. It's a file on the phone's filesystem, NOT the camera roll. It's the product of react-native-image-editor.

Tried using path with and without 'file://' prefix. Works fine on android. If i take the uri from the IOS simulator and paste it into chrome the picture appears. Using picture from the web doesn't work either which makes me think it's something to do with the styling.

const ImageAnalysis = (props) => {  const windowWidth = useWindowDimensions().width;  console.log(props.source);  const imageSource = props.source;  // const imagey = require(props.source.uri);  const realPath =    Platform.OS === 'ios'      ? imageSource.uri.replace('file://', '')      : imageSource.uri;  console.log(realPath);  console.log(windowWidth);  return (<View      style={{        flex: 2,        flexDirection: 'row',        borderBottomColor: colors.BrinkPink,        // backgroundColor: colors.RoyalPurple,        borderBottomWidth: 1,      }}><Image        source={{uri: props.source.uri}}        resizeMode="contain"        style={{          // position: 'relative',          height: windowWidth / 3,          width: windowWidth / 3,          borderRadius: windowWidth / 3,          margin: windowWidth / 12,          alignSelf: 'center',        }}      />

Viewing all articles
Browse latest Browse all 16552

Trending Articles



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