Skip to content

Commit 407cbb9

Browse files
committed
update
1 parent b79d43a commit 407cbb9

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![China.png](https://raw.githubusercontent.com/crazycodeboy/react-native-splash-screen/master/examples/Screenshots/China.png)**[简体中文](https://github.com/crazycodeboy/react-native-splash-screen/blob/master/README.zh.md) | [原理解析](https://github.com/crazycodeboy/RNStudyNotes/blob/master/React%20Native%20%E9%97%AE%E9%A2%98%E5%8F%8A%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E5%90%88%E9%9B%86/React%20Native%20%E5%90%AF%E5%8A%A8%E7%99%BD%E5%B1%8F%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%95%99%E7%A8%8B/React%20Native%20%E5%90%AF%E5%8A%A8%E7%99%BD%E5%B1%8F%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3%E6%95%99%E7%A8%8B.md)**
44

55

6-
A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
6+
A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
77

88
## Content
99

@@ -41,7 +41,7 @@ project(':react-native-splash-screen').projectDir = new File(rootProject.project
4141
dependencies {
4242
...
4343
compile project(':react-native-splash-screen')
44-
}
44+
}
4545
```
4646

4747
3.Update the MainApplication.java file to use `react-native-splash-screen` via the following changes:
@@ -74,12 +74,12 @@ public class MainApplication extends Application implements ReactApplication {
7474
**iOS:**
7575

7676
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
77-
2. Go to `node_modules``react-native-launch-image` and add `SplashScreen.xcodeproj`
77+
2. Go to `node_modules``react-native-splash-screen` and add `SplashScreen.xcodeproj`
7878
3. In XCode, in the project navigator, select your project. Add `libSplashScreen.a` to your project's `Build Phases``Link Binary With Libraries`
7979

8080

8181

82-
### Third step(Plugin Configuration):
82+
### Third step(Plugin Configuration):
8383

8484
**Android:**
8585

@@ -100,7 +100,7 @@ public class MainActivity extends ReactActivity {
100100

101101
You should add following code to AppDelegate.m for keeping launch image:
102102

103-
103+
104104
```obj-c
105105

106106
#import "AppDelegate.h"
@@ -112,7 +112,7 @@ You should add following code to AppDelegate.m for keeping launch image:
112112
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
113113
{
114114
// ...other code
115-
115+
116116
[SplashScreen show]; // here
117117
return YES;
118118
}
@@ -145,7 +145,14 @@ Add a file called launch_screen.xml in the layout as the splash screen.
145145
android:background="@drawable/launch_screen">
146146
</LinearLayout>
147147
```
148+
**Learn more to see [examples](https://github.com/crazycodeboy/react-native-splash-screen/tree/master/examples)**
149+
150+
151+
**iOS**
152+
153+
iOS can be used to customize your startup screen via LaunchImage or LaunchScreen.xib.
148154
155+
**Learn more to see [examples](https://github.com/crazycodeboy/react-native-splash-screen/tree/master/examples)**
149156
150157
Then you can use it like this:
151158
@@ -165,8 +172,8 @@ export default class WelcomePage extends Component {
165172

166173

167174
Method | Type | Optional | Description
168-
----------------- | -------- | -------- | -----------
169-
show() | function | false | Open splash screen
175+
----------------- | -------- | -------- | -----------
176+
show() | function | false | Open splash screen
170177
hide() | function | false | Close splash screen
171178

172179
## Contribution

README.zh.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ project(':react-native-splash-screen').projectDir = new File(rootProject.project
4242
2.在你的 android/app/build.gradle 文件中添加 `:react-native-splash-screen`
4343

4444
代码如下:
45-
45+
4646
```
4747
...
4848
dependencies {
4949
...
5050
compile project(':react-native-splash-screen')
51-
}
51+
}
5252
```
5353

5454
3.更新你的MainApplication.java 文件,如下:
@@ -81,13 +81,13 @@ public class MainApplication extends Application implements ReactApplication {
8181
**iOS:**
8282

8383
1. 在 XCode的项目导航视图中单击 `Libraries``Add Files to [your project's name]`
84-
2.`SplashScreen.xcodeproj`添加到你的项目中,`node_modules``react-native-launch-image``SplashScreen.xcodeproj`
84+
2.`SplashScreen.xcodeproj`添加到你的项目中,`node_modules``react-native-splash-screen``SplashScreen.xcodeproj`
8585

8686
3. 在XCode中打开`Build Phases``Link Binary With Libraries``libSplashScreen.a` 添加到你的项目中。
8787

8888

8989

90-
### 第三步(配置):
90+
### 第三步(配置):
9191

9292
**Android:**
9393

@@ -107,7 +107,7 @@ public class MainActivity extends ReactActivity {
107107

108108
更新你的AppDelegate.m 文件如下:
109109

110-
110+
111111
```obj-c
112112

113113
#import "AppDelegate.h"
@@ -119,7 +119,7 @@ public class MainActivity extends ReactActivity {
119119
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
120120
{
121121
// ...other code
122-
122+
123123
[SplashScreen show]; // 添加这一句,这一句一定要在最后
124124
return YES;
125125
}
@@ -154,10 +154,14 @@ public class MainActivity extends ReactActivity {
154154
</LinearLayout>
155155
```
156156
157+
**更详细的介绍,可以查看 [examples](https://github.com/crazycodeboy/react-native-splash-screen/tree/master/examples)**
158+
157159
**iOS**
158160
159161
iOS可以通过LaunchImage或LaunchScreen.xib来自定义你的启动屏幕。
160162
163+
**更详细的介绍,可以查看 [examples](https://github.com/crazycodeboy/react-native-splash-screen/tree/master/examples)**
164+
161165
最后,你可以在适当的时候关闭启动屏幕(如:启动初始化完成后):
162166
163167
```JavaScript
@@ -176,8 +180,8 @@ export default class WelcomePage extends Component {
176180

177181

178182
方法 | 类型 | 可选 | 描述
179-
----------------- | -------- | -------- | -----------
180-
show() | function | false | 打开启动屏幕
183+
----------------- | -------- | -------- | -----------
184+
show() | function | false | 打开启动屏幕
181185
hide() | function | false | 关闭启动屏幕
182186

183187
## 贡献

0 commit comments

Comments
 (0)