android - 字体系列materialicon不是系统字体
问题描述
我的代码正在使用 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"
},
应用程序.json:
"expo": {
"name": "AwesomeProject",
"slug": "AwesomeProject",
"privacy": "public",
"sdkVersion": "29.0.0",
"platforms": [
"ios",
"android"
],
...
解决方案
如果您按照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 上被破坏,所以为了您的方便,这里是手动 android 链接的指南。react-native-vector-icons
推荐阅读
- amazon-web-services - CloudWatch PutMetricData 值范围
- javascript - 只有某些跨源请求使用 npm cors()
- python - 欧拉项目问题4 不知道为什么代码不起作用
- python-3.x - Python 3:使用 if else 并附加到列表的字典理解
- bash - 在变量内调用命令时找不到命令
- ios - 视图控制器上的停止计时器快速关闭
- c# - 对于 GetRecords 结果的 foreach 失败,但 ToList() 解决了它
- python - AttributeError:“NoneType”对象没有属性“fit_generator”
- swift - MacOS Swift,使用参数将数据发送到 USB 设备
- sql - MSSQL 重复键行异常