【问题标题】:React Native Paper - Unrecognized font family 'Material Icons'React Native Paper - 无法识别的字体系列“材料图标”
【发布时间】:2023-04-03 07:09:02
【问题描述】:

我正在创建一个新的 react native 应用程序并使用 react-native-paper。这不是一个 Expo 应用程序,而是一个香草反应原生应用程序。

react native 版本 > 0.6.0 并且我已经按照 react-native-paper 安装https://callstack.github.io/react-native-paper/getting-started.html中描述的步骤进行操作

react-native-paper 组件的使用方式如下

<Avatar.Icon size={24} icon="folder" />

但是,当我使用命令react-native run-ios 运行应用程序时,编译成功并且应用程序打开但红屏显示如下

【问题讨论】:

    标签: react-native react-native-paper


    【解决方案1】:

    找到了解决办法。

    我必须将以下内容添加到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>
    

    【讨论】:

    • 谢谢!花了一个小时调试这个问题,这就是解决方案!
    • 谢谢!有类似的问题,只有你的解决方案对我有用。真的很奇怪,为什么官方文档中没有提到这一点。
    猜你喜欢
    • 2019-08-05
    • 1970-01-01
    • 2016-10-24
    • 2022-07-18
    • 2019-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-03
    相关资源
    最近更新 更多