Skip to content

Commit 3b79266

Browse files
author
suibingyue
committed
Merge branch 'master' of github.com:bigsui/shopping-react-native
2 parents 00987a7 + 5b8c7aa commit 3b79266

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# React-Native入门指南
2+
3+
## shopping-react-native
4+
### 一、前言
5+
6+
整个代码,仅供参考,对于一个有经验的开发人员,从看js Reactjs React-Native 到写demo总共2天时间就够了,由于没有做过前端,代码写的一般,见谅;后去会持续更新
7+
8+
### 二、环境配置
9+
(1)需要一台Mac(OSX),这个是前提,建议还是入手一本啦。
10+
(2)在Mac上安装Xcode,建议Xcode 6.3以上版本
11+
(3)安装node.js:https://nodejs.org/download/
12+
(4)建议安装watchman,终端命令:brew install watchman
13+
(5)安装flow:brew install flow
14+
### 三、Hello, React-Native
15+
创建一个React-Native的项目,因此可以按照下面的步骤:
16+
打开终端
17+
18+
(1)安装命令行工具:sudo npm install -g react-native-cli
19+
(2)创建一个空项目:react-native init HelloWorld
20+
(3)找到创建的HelloWorld项目,双击HelloWorld.xcodeproj即可在xcode中打开项目。xcodeproj是xcode的项目文件。
21+
(4)在xcode中,使用快捷键cmd + R即可启动项目。基本的Xcode功能可以熟悉,比如模拟器的选择等。
22+
(5)android 开发者请安装android开发环境,后打开模拟器 使用react-native run-android命令来运行程序
23+
24+
启动完成后,你会看到React-Packger和iOS模拟器(android模拟器)
25+
26+
### 四、shopping-react-native demo
27+
28+
图片轮播使用的是三方组件react-native-swiper,我们启动npm命令行,在项目的根目录使用如下命令安装模块。
29+
30+
$ npm install react-native-swiper --save
31+
$ npm i react-timer-mixin --save
32+
33+
### 实战内容
34+
35+
9宫格,轮播图,导航栏,tab栏,Webview,ListView,ScrollView等
36+
37+
### 效果图预览
38+
39+
![image](https://github.com/bigsui/shopping-react-native/blob/master/screenshot/rn1.png)
40+
41+
![image](https://github.com/bigsui/shopping-react-native/blob/master/screenshot/rn2.png)
42+
43+
![image](https://github.com/bigsui/shopping-react-native/blob/master/screenshot/rn3.png)
44+
45+
![image](https://github.com/bigsui/shopping-react-native/blob/master/screenshot/rn4.png)
46+
47+
48+
49+

screenshot/rn1.png

712 KB
Loading

screenshot/rn2.png

309 KB
Loading

screenshot/rn3.png

273 KB
Loading

screenshot/rn4.png

200 KB
Loading

0 commit comments

Comments
 (0)