简体   繁体   English

我如何将 Font Awesome Pro 与 NativeBase 的图标一起使用?

[英]How do I use Font Awesome Pro with NativeBase's Icon?

How do I use Font Awesome Pro with NativeBase ?如何将 Font Awesome Pro 与NativeBase一起使用?

I can use a non-pro icon by following the documentation with, for example:我可以按照文档使用非专业图标,例如:

import { Icon } from 'native-base'
<Icon type="FontAwesome5" name="comment" />

but it's unclear what else I need to do to ensure I can use a pro icon, for example :但不清楚我还需要做些什么来确保我可以使用专业图标,例如

<Icon type="FontAwesome5" name="user-md-chat" />

What do I need to do to get access to pro icons through native-base 's Icon component?我需要做什么才能通过native-baseIcon组件访问专业图标

You can use FontAwesome icon in native-base style by passing the icon property.您可以通过传递icon属性以原生样式使用 FontAwesome 图标。 In your case, this should work:在您的情况下,这应该有效:

import { Icon } from 'native-base';
import { faUserMd } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome";

<Icon as={FontAwesomeIcon} icon={faUserMd} />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM