gpt4 book ai didi

react-native - 无法识别的字体系列图标

转载 作者:行者123 更新时间:2023-12-04 02:32:35 26 4
gpt4 key购买 nike

我按照 NativeBase Docs 中的设置说明进行操作然后跑 rnpm link .我收到此错误:
Unrecognized font family ionicons

也由 Xcode 检查,字体已经处于构建阶段。
我错过了什么?

最佳答案

对于 RN 0.60+ 不要使用 react-native link ... ! (见 Autolinking)

而是将其添加到您的 Podfile 中:

pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

并运行 pod update (或 pod install)。

此外,将此添加到您的 Info.plist 中:
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>

(取自 https://github.com/oblador/react-native-vector-icons#option-with-cocoapods)

在我的项目中工作正常:
"react": "16.9.0",
"react-native": "0.61.1",
"native-base": "2.13.8" (react-native-vector-icons@6.6.0),

关于react-native - 无法识别的字体系列图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38713240/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com