Last active
February 24, 2016 16:48
-
-
Save StefanWallin/3abbb026c03615545bd8 to your computer and use it in GitHub Desktop.
Including static images in React Native not working :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requiring unknown module "image!backdrop". If you are sure the module is there, try restarting the packager. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var backdrop = ( | |
<Image source={require('image!backdrop')}> | |
<Text style={styles.welcome}>heading</Text> | |
</Image> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls -1 iOS/Images.xcassets/backdrop.imageset/ | |
Contents.json | |
backdrop-1.jpg | |
backdrop-2.jpg | |
backdrop.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"images" : [ | |
{ | |
"idiom" : "universal", | |
"scale" : "1x", | |
"filename" : "backdrop.jpg" | |
}, | |
{ | |
"idiom" : "universal", | |
"scale" : "2x", | |
"filename" : "backdrop-1.jpg" | |
}, | |
{ | |
"idiom" : "universal", | |
"scale" : "3x", | |
"filename" : "backdrop-2.jpg" | |
} | |
], | |
"info" : { | |
"version" : 1, | |
"author" : "xcode" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment