字体系列materialicon不是系统字体

时间:2019-01-24 08:33:29

标签: android react-native fonts expo

我的代码正在使用react-native-paper工具箱。 但不是直接有任何图标。 并且不在我的代码中加载任何自定义字体。 捆绑软件下载后,会出现红色屏幕崩溃。 我在Android 8.1上运行它。节点10.4和npm 6.5。

请提出建议。

我的package.json:

  "dependencies": {
    "expo": "^29.0.1",
    "react": "16.5.0",
    "react-native": "~0.55.4",
    "prop-types": "^15.0.0",
    "eslint": "^3.17.0",
    "react-native-navigation": "^2.5.2",
    "react-native-paper": "^2.5.0",
    "react-native-permissions": "^1.1.1",
    "react-native-status-bar-height": "*",
    "react-native-vector-icons": "^6.1.0",
    "react-navigation": "^3.0.9"
  },
  "devDependencies": {
    "babel-preset-expo": "^4.0.0"
  },

App.json:

"expo": {
    "name": "AwesomeProject",
    "slug": "AwesomeProject",
    "privacy": "public",
    "sdkVersion": "29.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    ...

1 个答案:

答案 0 :(得分:1)

如果您遵循instructions of react-native-paper,它会告诉您它需要安装react-native-vector-icons才能工作:

yarn add react-native-vector-icons OR npm install react-native-vector-icons
react-native link react-native-vector-icons

请注意,react-native的链接在android上经常会中断,因此herereact-native-vector-icons的手动android链接指南,为您提供方便。