React Native 使用精美图标库react-native-vector-icons

一、安装依赖

npm install --save react-native-vector-icons // 下载库
react-native link react-native-vector-icons // 自动关联

 

二、使用

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

<FontAwesome name={'wpforms'} size={30} color={tintColor} /> 

<MaterialCommunityIcons name={'face'} size={30} color={tintColor} /> 

 

使用说明:
react-native-vector-icons 的图标分为几个模块, 使用的时候先import FontAwesome from 'react-native-vector-icons/FontAwesome';

这样才能使用 FontAwesome 标签, 标签内使用 name 字段指定是某个图标.

使用的时候可以使用这个网站找到所有图标的索引:
https://oblador.github.io/react-native-vector-icons/

本博客地址: wukong1688

本文原文地址:https://www.cnblogs.com/wukong1688/p/10860490.html

转载请著名出处!谢谢~~

相关文章:

  • 2021-11-29
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2021-11-10
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-05-12
  • 2022-12-23
  • 2022-02-09
  • 2021-06-15
相关资源
相似解决方案