2016-12-27 66 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

太棒了,請將問題標記爲已回答;) –