react-native - 如何像 react-native-elements 一样在没有按钮组件的情况下在 react-native-paper 中获取图标组件

标签 react-native icons react-native-elements react-native-paper

我正在使用 react-native-paper 并且我想获得一个 Icon 组件 但没有与 Button 组件的任何链接。我经历了the doc而且我没有找到图标组件。我想要类似于 react-native-elements 的东西

import { Icon } from 'react-native-elements'


<Icon
  name='g-translate'
  color='#00aced' />

所以请帮助我实现这一目标。

最佳答案

您可以使用“react-native-vector-icons”库,因为 react-native-paper 中的图标来自 react-native-vector-icons。 这是代码:

import Icon from 'react-native-vector-icons/FontAwesome'; const myIcon = <Icon name="rocket" size={30} color="#900" />;

关于react-native - 如何像 react-native-elements 一样在没有按钮组件的情况下在 react-native-paper 中获取图标组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62013981/

相关文章:

ios - 无法再启动 React Native 0.15

javascript - 当包括胜利图表时, react native slider 变得滞后并且状态值变化最近反射(reflect)出来

android - 应用程序打开为 "background process"。有可能 react native 吗?

java - 如何将我的 Java 程序放入系统托盘?

c# - 以编程方式更改 WPF 中的按钮图标

c# - 如何在窗口上设置图标

react-native - React Native slider 存在滞后问题

react-native - 错误 : Error: Unable to resolve module ./ Hook 来自/node_modules/react-native-reanimated/src/reanimated2/index.ts

javascript - React Native NetInfo 'hander is not a function' 错误代码