英文:
Unrecognized font family - custom fonts in react native
问题
Error: "Unrecognized font family"
我无法弄清楚为什么我的自定义字体无法被识别。
我已经完成了以下步骤:
- 在 assets/fonts 文件夹中添加了自定义字体文件。我尝试了多个不同的字体。
- 创建了 react-native.config.js 文件,其中包含 "assets": ['./assets/fonts']
- Pod deintegrate / pod install
- npx react-native-asset
- 更新了 Xcode 中的 plist 值,以指向这些字体
*我正在运行 react-native 0.71.5
英文:
Error: "Unrecognized font family"
I cannot for the life of me figure out why my custom fonts are not being recognized.
I have done the following:
- Add custom font files in assets/fonts folder. I tried multiple different fonts.
- Create react-native.config.js file with "assets": ['./assets/fonts']
- Pod deintegrate / pod install
- npx react-native-asset
- Update the plist values in xcode to point to the fonts
*I am running react-native 0.71.5
答案1
得分: 1
你试过链接你的资产吗?
npx react-native link
npx react-native-asset
英文:
Did you tried to link your assets ?
npx react-native link
npx react-native-asset
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论