How to add custom font in react native android

后端 未结 13 1269
别那么骄傲
别那么骄傲 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 12:58

    For Android :

    put your custom fonts in the following folder:

    Project folder/android/app/src/main/assets/fonts/font_name.ttf

    Run react-native run-android

    Use the font i your code:

    title: { fontSize: 20, fontFamily: " font Name" },

提交回复
热议问题