-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRN运行说明.txt
71 lines (55 loc) · 1.86 KB
/
RN运行说明.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
初始化项目
npx react-native init Demo
查看设备,
adb devices
打开调试模式
adb reverse tcp:8081 tcp:8081
运行安卓版本
npx react-native run-android
运行iOS版本
cd ios
pod install
cd ..
npx react-native run-ios
启动项目
react-native start
npx react-native init Demo
adb devices
adb reverse tcp:8081 tcp:8081
npx react-native run-android
npx react-native run-ios
react-native start
react-navigation导航安装依赖
yarn add react-navigation react-native-gesture-handler react-native-reanimated react-native-vector-icons react-native-safe-area-context @react-native-community/masked-view react-native-screens react-navigation-stack react-navigation-tabs
引入UI组件
https://github.com/react-native-elements/react-native-elements
例如,引入Button组件和使用
import { Button } from 'react-native-elements';
<Button />;
icon第三方库
yarn add react-native-vector-icons
react-native link react-native-vector-icons
图标网址
https://zamarrowski.github.io/react-ionicons
引用图标
import Octicons from 'react-native-vector-icons/Octicons';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import Ionicons from 'react-native-vector-icons/Ionicons';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
https://github.com/lirongNISL/RN.git
github本地上传
1…or create a new repository on the command line
echo "# RN" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/lirongNISL/RN.git
git push -u origin master
2…or push an existing repository from the command line
git remote add origin https://github.com/lirongNISL/RN.git
git push -u origin master
3…or import code from another repository
git add .
git commit -m "提交信息"
git remote add origin https://github.com/lirongNISL/RN.git
git push -u origin master