How to add custom font in react native android

后端 未结 13 1258
别那么骄傲
别那么骄傲 2020-12-01 12:28

I am learning react-native, trying to create some demo apps just for learning. I want to set fontFamily to roboto thin of my toolbar title.

<
13条回答
  •  鱼传尺愫
    2020-12-01 13:04

    1. Add your fonts file in

      • Project folder/android/app/src/main/assets/fonts/font_name.ttf
    2. Restart the package manager using react-native run-android
    3. Then you can use your font in your style e.g
      • fontFamily: 'font_name'

    Check here for further examples Custom Font Examples

提交回复
热议问题