1.在根目录执行

npm install react-native-vector-icons --save 

或者:

yarn add react-native-vector-icons --save

2.自动关联

react-native 版本大于0.30时可使用

react-native link; //自动关联

//手动关联可查阅

https://www.npmjs.com/package/react-native-vector-icons

3.引用

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

4.报错

react-native-vector-icons 安装以及常见问题处理

可修改项目权限,勾去只读选项

react-native-vector-icons 安装以及常见问题处理

重新执行react-native run-android

相关文章: