1. npm install react-native-vector-icons --save 或者 yarn react-native-vector-icons
2.配置安卓:将项目中node-modeles\react-native-vector-icons\Fonts目录下所有ttf文件复制到
项目andriod\app\src\main\assets\fonts目录下 (assets\fonts没有则新建文件夹)
3.修改andriod/app目录下的build.gradle文件,在文件最上面增加 apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" ( android/app/build.gradle ( 不是 android/build.gradle ))
4.配置iOS: pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
5.在RN项目找那个导入组件
import FontAwesome from 'react-native-vector-icons/dist/FontAwesome'
图例地址:https://oblador.github.io/react-native-vector-icons/
网友评论