Home > Enterprise >  React Native: Image is not properly showing
React Native: Image is not properly showing

Time:12-08

I am running into an issue when trying to display the image. I'm not sure where to go from here.

enter image description here

enter image description here

enter image description here

enter image description here

CodePudding user response:

You can try giving some width and height to the image component like

 <Image
   style={{width: 50, height: 50}} //or 100%
   source={require("dir")} // Make sure image dir is correct
   />

Hope it will help solve your problem.

CodePudding user response:

Please check your image directory is correct or not.

Ctrl Click to your image assets directory. If image can open, it is correct route. If not, you need to check your image directory again.

imageSource={(require('../../assets/image.png'))}

for me, I put code under 'src', so my image assets directory become

imageSource={(require('../../src/assets/image.png'))}

  • Related