无法识别的字体系列图标 [英] Unrecognized font family ionicons
本文介绍了无法识别的字体系列图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我按照NativeBase Docs 中的设置说明运行了rnpm link
.我收到此错误:无法识别的字体系列离子
I followed the setup instructions in the NativeBase Docs and ran rnpm link
. I am getting this error:
Unrecognized font family ionicons
也经过Xcode检查,字体已经在构建阶段.我错过了什么?
also checked by Xcode, the fonts are already in the build phase. What am I missing?
推荐答案
对于 RN 0.60+ 不要使用 react-native link ...
!(请参阅自动链接)
For RN 0.60+ don't use react-native link ...
! (see Autolinking)
改为将其添加到您的 Podfile
中:
Instead add this in your Podfile
:
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
并运行pod update
(或pod install
).
在您的 Info.plist
中进一步添加:
Furthermore add this in your 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)
在我的项目中运行良好:
Works fine in my project with:
"react": "16.9.0",
"react-native": "0.61.1",
"native-base": "2.13.8" (react-native-vector-icons@6.6.0),
这篇关于无法识别的字体系列图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文