Reputation: 1976
I am trying to display a static image(ic_launcher) in my android app using react native. I am getting a black response. No errors. Just a blank view as though the resource doesn't exist.I am able to display images from the network.
Upvotes: 3
Views: 2692
Reputation: 1050
Your ic_launcher files are probably placed in android/app/src/main/res/mipmap-xxx directories. Try to move it to android/app/src/main/res/drawable-xxx directories.
Upvotes: 5
Reputation: 2664
You should use require('image!img_name')
as a source
attribute of Image
component.
See example app here https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/ImageExample.js#L84 with it's resource placed under https://github.com/facebook/react-native/tree/master/Examples/UIExplorer/android/app/src/main/res/drawable
Upvotes: 0
Reputation: 1
Upvotes: 0