gpt4 book ai didi

react-native - 错误 : Unrecognized font family Material Design icons after installing react-native-elements?

转载 作者:行者123 更新时间:2023-12-03 15:52:26 26 4
gpt4 key购买 nike

我是 react-native 的新手。我使用 react-native-cli 创建了一个新项目。
我正在使用 react-native-element 作为 React Native 的 UI 组件库。所以我运行了以下命令

**npm i react-native-elements --save**

在此之后,我运行了我的模拟器命令,

react-native run-ios

不知道如何解决这个错误。

最佳答案

如果您来自 react-native 0.60+,请在 info.plist 文件中添加 UIAppFonts(如下所述)。并将 node_modules/react-native-vector-icons 下的 fonts 文件夹拖放到 xcode 中的项目中。 确保在“添加到目标”下选中了您的应用,如果添加整个文件夹,则选中“创建组”。

<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>

关于react-native - 错误 : Unrecognized font family Material Design icons after installing react-native-elements?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48601206/

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