【问题标题】:react-native-vector-icons/ react-native-elements not workingreact-native-vector-icons/react-native-elements 不起作用
【发布时间】:2020-07-08 07:46:55
【问题描述】:

我已经尝试了所有方法,但无法解决此错误。请帮忙替换这个box instead of icon import { Icon } from 'react-native-elements' <Icon name="glass" ></Icon>

【问题讨论】:

  • 欢迎使用 Stack Over Flow,请发布您尝试过的代码,它可以让我们更轻松地为您提供帮助。
  • 你可以在你的帖子中编辑你的问题有一个edit

标签: android reactjs react-native expo react-native-vector-icons


【解决方案1】:

你可以这样尝试:

import FontAwesome from "react-native-vector-icons/FontAwesome";
...

<FontAwesome
    name={"glass"}
    size={30}
    color="#000000" 
/>        

Code example on expo

【讨论】:

    【解决方案2】:

    如果你想使用 react-native-elements 你应该尝试使用 props type,像这样:

    <Icon
        name='glass'
        type='font-awesome'
        onPress={() => console.log('hello')}
    />
    

    如果图标仍然没有显示,你必须试试这个:

    react-native link
    

    如上所述here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 2018-12-25
      • 2017-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多