react-native 可以将react组建编译成原生的组件,从而提高允许效率和性能,作为一个小白,RN环境搭建也折腾了很久,做个笔记记录下搭建的过程。
- 安装NPM(>5.0)
- 通过npm install -g react-native-cli 全局安装react-native命令环境
- 通过react-native init ProjectName 初始化一个项目
- 通过react-native start 启动并打开 http://localhost:8081/index.android.bundle?platform=android 查看内容,如响应正常,代表start成功
- 通过react-native run-android 编译并安装apk到模拟器
- 可能先要下载grade 编译工具,但是由于命令行下载的确比较慢,直接复制下载地址到迅雷里面下载
https://services.gradle.org/distributions/gradle-2.14.1-all.zip,然后将下载的包放到用户目录 C:\Users\{UserName}\.gradle\wrapper\dists\gradle-2.14.1-all\8bnwg5hd3w55iofp58khbp6yv 解压即可
- 再次运行react-native run-android 会下载相关依赖jar包,并编译(需要先设置ANDROID_HOME,启动模拟器),最后查看效果
相关推荐
React本机瀑布列表 增强的,动画的和可自定义的react-native-waterfall-list。 react-native-waterfall-list是扩展............特征流畅的输入/退出动画设置该库在npm上可用,可通过以下方式安装: npm i react-...
1.实现播放、暂停视频;...下载代码之后:npm install,然后npm start,然后npm link 安装包(react-native link react-native-orientation,react-native link react-native-video),然后再链接即可查看效果
灵感来自phonegap-nfc和react-native-ble-manager 该库最简单(也是最常见)的用例是读取NFC包含 的标签NDEF,可以通过以下代码实现: import React from 'react'; import {View, Text, TouchableOpacity, ...
环境是nodejs-V14,当你安装好android sdk这些以后,解压到指定文件夹就是RN的空项目,已经包含常用插件react-navigaition,react-native-webview,native-base。同时默认支持Hermes引擎,minifyEnabled已经开启,若...
项目地址:https://github.com/race604/react-native-viewpager 效果图:使用说明: 运行 npm 安装 react-native-viewpager --save代码如下:var ViewPager = require('react-native-viewpager'); ...
react-native-video A <Video> component for react-native, as seen in react-native-login! Version 4.x requires react-native >= 0.57.0 Version 3.x requires react-native >= 0.40.0 Version 4.0.0 ...
react-native-workers, 后台服务和用于响应本机的网络工作者 react-native-workers在后台运行旋转工作线程并运行CPU密集型任务。 Android上的加分点:即使用户退出应用程序,也可以保持工作状态
react-native-ble-manager This is a porting of https://github.com/don/cordova-plugin-ble-central project to React Native. Requirements RN 0.40 RN 0.30-0.39 supported until 2.4.3 Supported Platforms...
https://github.com/jitsi/jitsi-maven-repository/tree/master/releases/com/facebook/react/react-native-locale-detector ...
React-Native tabbar 的简单使用
react-native-html-to-pdf, 将html字符串转换为PDF文档 react-native-html-to-pdf将html字符串转换为PDF文档安装运行 npm install react-native-html-to-pdf --save选项 1: 自动运行 react-native
react-native-charts-wrapper图表库页面布局使用案例,资源仅包含页面布局样式展示,可结合博客https://blog.csdn.net/zcmain/article/details/107909374观看
react-native-sms, 支持iOS和Android的短信发送方 react-native-sms用户定义的SendSMS使用这个 rn 组件发送带有回调 (completed/cancelled/error). iOS和Android的短信。目前,只支持用户发送短信。 this react-na
react-native-webview.zip
react-native-image-picker 使用demo 详见:https://github.com/pheromone/mycamera
解决React-Native的WebView不支持Android选择图片和拍照
react-native-svg-uri, 在来自URL或者 static 文件的本地响应中,呈现SVG图像 react-native-svg-uri从URL或者 static 文件中呈现来自React的SVG图像这是用 rn 0.33和 react-native-svg 4.3.1 ( 依赖于此库) react-...
npm install --save react-native-push-notification react-native link NOTE: For Android, you will still have to manually update the AndroidManifest.xml (as below) in order to use Scheduled Notifications...
react-native-version-number, 获取应用程序的版本号和内部版本号 react-native-version-number 返回 CFBundleShortVersionString 上的和 CFBundleVersion 和 bundleIdentifier 。 对于 Android,返回
react-native 0.58 版本,运行 react-native run-ios 需要的第三方依赖包 缺少该资源包会导致 ":CFBundleIdentifier", Does Not Exist 错误 下载资源后解压缩到 ~/.rncache目录下面即可