dev-jim
dev-jim

Reputation: 2524

custom font for both ios and Android in react native

I follow this to install custom in RN. It works in Android but not in ios.

When running on ios, is shows error with font not found.

How do I make it work for both ios and Android?

Upvotes: 2

Views: 1359

Answers (1)

Abdulaziz Alkharashi
Abdulaziz Alkharashi

Reputation: 1316

Simply create an 'assets' folder in the root of your project (or wherever you want), drop in your font files, and define it in your project's package.json.

"rnpm": {
  "assets": ["assets"]
},

Then, run react-native link and besides linking 3rd party modules, it will now also link any fonts you put in there with the respective project files.

from React Native: Things I wish I knew before starting out.

Upvotes: 5

Related Questions