在React Native iOS中添加自定义字体系列

问题描述 投票:0回答:1

我想在iOS上的React Native App上添加自定义字体系列。我对Android没有问题,但我在iOS中出错了:

无法识别的字体系列'dinproRegular'

我使用this link来设置我的字体,但没有结果。

文件名:dinproRegular.ttf

打电话给本土:fontFamily: "dinproRegular" // Test with "Dinpro Regular" too

没有结果 :(

有人有想法吗?

ios xcode reactjs react-native
1个回答
1
投票

只需检查Ios或Android中当前安装的字体:

https://github.com/react-native-training/react-native-fonts

如果要添加自定义字体:

https://medium.com/@danielskripnik/how-to-add-and-remove-custom-fonts-in-react-native-b2830084b0e4

希望能帮助到你!

© www.soinside.com 2019 - 2024. All rights reserved.