How to add custom font in react native android

后端 未结 13 1229
别那么骄傲
别那么骄傲 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:56

    @nitin-anand's answer was the most appropriate and cleaner than the rest, but that method is now deprecated and now we will have to create a react-native.config.js file in our root with the following configuration as an example:

    module.exports = {
     project: {
      ios: {},
      android: {},
     },
     assets: ['./assets/fonts'], 
    }; 
    

提交回复
热议问题