Mayoul
Mayoul

Reputation: 626

Red square rendering instead of the AwesomeFont Icon

I was following this github : https://github.com/corymsmith/react-native-icons to learn how to put some icon on my app ! So i did all they said :

-include in android/setting.gradleand android/app/build.gradle the differents parts of code.

-do the register module (in MainActivity.java), the import in my corresponding MainActivity.Java

-Copy the font files and .json in the directory assets that i just create...

Paste the onCreate in my MainActivity.java with the references .addPackage(new ReactNativeIcons(Arrays.asList( new IconFont("typicons", "typicons.ttf")

And so do my call <Icon name='typicons|beer' size={150} color='#887700' style={styles.beer}/>

with this styles

beer: { width: 50, height: 50, margin: 5, color: '#887700' },

But my app display just a red square at this emplacement. Just the borders are red, and the inside is white... I have no errors. So did i forgot something ? If you have any ideas to help me ! :) It's very strange :/

Thank's !

Upvotes: 1

Views: 565

Answers (1)

Mayoul
Mayoul

Reputation: 626

I'm new in react-native framework... And I didn't know that I will had to do "react-native run-android" . I thought that doing "rnpm link"... and "reload JS" will make the update of the new node_module....

So I re-install my app with "react-native run-android" which take in parameter the new node_module... And it work's now ! thank's @Vikky ! And I will know that, for the next time :p

Upvotes: 2

Related Questions