reactjs - react-native-vector-icon 显示“错误”图标
问题描述
我正在使用react-native-vector-icons
我的 React 本机项目。最近,当我打开我的应用程序时,它一直显示我在该name
字段中填写的错误图标,或者显示该图标不存在(“问号”)。
我觉得很尴尬,因为大约一两周后就正常了。我一直在 SOF 或他们的 github 上搜索,但感觉没有希望。
你能帮我解决这个问题吗?
<Icon
containerStyle={{
display: (this.state.email.length > 0) ? 'flex' : 'none',
marginRight: normalize(10),
}}
name="mail-outline"
type="ionicon"
color="#7384B4"
size={22}
onPress={() => {
this.setState({ email: '' });
}}
/>
这是我在我的package.json
"react": "16.9.0",
"react-native": "0.61.3",
"react-native-elements": "^1.2.0",
"react-native-vector-icons": "^7.0.0",
谢谢,祝你有美好的一天。
解决方案
I had the same problem. It's related to manually linking vs autolinking (new version)
Solution:
npx react-native unlink react-native-vector-icons
npm run android
npm run android actually runs: react-native run-android
推荐阅读
- python-3.x - 我需要使用 Appium 和 python (pytest) 从应用程序中打印信号强度
- python - 如何删除或添加以特定字符或字符串开头的句子?
- c# - 如何在android C#中将按钮文本设置为“<”?
- c# - 是否可以将按钮添加到 Excel 图表自定义按钮?
- java - 如何为错误和正确的类分配 if 语句
- javascript - 在 pact-lang 智能合约中获取 tx 发件人数据
- php - Merging values in array of objects depending on matching values
- android - 在android中创建另一个字符串xml值文件
- python - Python多线程队列保持“空”
- webgl - 如何使用 WebGL 设置动画速度