How to set default font family in React Native?

后端 未结 10 1003
鱼传尺愫
鱼传尺愫 2020-11-29 00:25

Is there an equivalent to this CSS in React Native, so that the app uses the same font everywhere ?

body {
  font-family: \'Open Sans\';
}

10条回答
  •  隐瞒了意图╮
    2020-11-29 01:08

    That works for me: Add Custom Font in React Native

    download your fonts and place them in assets/fonts folder, add this line in package.json

     "rnpm": {
    "assets": ["assets/fonts/Sarpanch"]}
    

    then open terminal and run this command: react-native link

    Now your are good to go. For more detailed step. visit the link above mentioned

提交回复
热议问题