Mac中react-native 环境的搭建、react-navigation路由 环境搭建、react-native-vector-icons 安装图标

react-native 环境的搭建

  1. 全局安装
sudo npm i watchman react-native-cli -g

2.构建项目

react-native init +项目名

安装过程中勾选gem cocospods … 即可

3.启动项目

npm run ios

react-navigation路由 环境搭建 实现路由跳转功能

1.在项目目录安装

npm install --save react-navigation-tabs react-navigation react-native-gesture-handler react-navigation-stack @react-native-community/masked-view 
npm i react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context -S

2.cd ios文件夹

pod install

3.启动项目即可

native-vector-icons 安装图标

1.在项目目录安装

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

2.找到info.plist文件(ios—项目名文件夹—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>

3.cd ios 执行
js pod install

4.启动项目即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值