2016-12-27 109 views
5

在我的react-native应用程序中,我添加了这个库react-native-vector-icons来使用图标。从github页面,FontAwesome被列入捆绑图标集中。但我不明白我如何才能在我的元素中引用一个精彩的项目。看来我只能使用“ios-xxx”,“md-xxx”或“log-xxx”。react-native react-native-vector-icons:如何使用字体真棒图标

当我尝试类似:

<Icon name='fa-rss' style={{marginRight:10}} /> 

我得到这样的警告:

enter image description here

回答

17

使用

import Icon from 'react-native-vector-icons/FontAwesome'; 

<Icon name="rss" size={30} color="#900" /> 
+0

感谢您的快速答复。我尝试了你的代码: , still same error – TheSoul

+0

非常感谢,现在正在工作 – TheSoul

+0

太棒了,请将问题标记为已回答;) –