1、安装
yarn add react-native-vector-icons(或者 npm install react-native-vector-icons)
2、react-native link react-native-vector-icons 进行自动连接,如果报错,react-native unlink react-native-vector-icons这样先卸载掉之前的link,然后:
命令运行:pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
命令运行:pod update (or pod install).
在到Info.plist文件添加:
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
<string>EvilIcons.ttf</string>
<string>Feather.ttf</string>
<string>FontAwesome.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>Zocial.ttf</string>
</array>
我用的ios起来就成功了