crazycodeboy /react-native-splash-screen

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

★ 5,653⑂ 1,095👁 59⑃ 153● 519▤ 12
JavaMITCreated 2016-09-14
下载:v3.3.0v3.3.0 ↓3.3.02021-12-11
+0
日增长
5,653
stars
1,095
forks
59
watchers
153
prs
519
issues
12
releases

README

react-native-splash-screen


![Download ](https://www.npmjs.com/package/react-native-splash-screen)
 ![PRs Welcome](https://github.com/crazycodeboy/react-native-splash-screen/pulls)
 ![react-native-splash-screen release](https://github.com/crazycodeboy/GitHubPopular/releases)
 ![语言 中文](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)
 ![Flutter](https://github.com/crazycodeboy/flutter_splash_screen)

A splash screen API for react-native which can programatically hide and show the splash screen. Works on iOS and Android.

 Content

- Changes
- Installation
- Examples
- Getting started
- API
- Testing
- Troubleshooting
- Contribution


 Changes
For React Native = 0.47.0 use v3.+, for React Native = 0.3.1
import org.devio.rn.splashscreen.SplashScreenReactPackage;
// react-native-splash-screen  getPackages() {
            return Arrays.asList(
                    new MainReactPackage(),
            new SplashScreenReactPackage()  //here
            );
        }
    };

    @Override
    public ReactNativeHost getReactNativeHost() {
        return mReactNativeHost;
    }
}


iOS:

1. cd ios
2. run pod install

OR

1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
2. Go to node_modules ➜ react-native-splash-screen and add SplashScreen.xcodeproj
3. In XCode, in the project navigator, select your project. Add libSplashScreen.a to your project's Build Phases ➜ Link Binary With Libraries
4. To fix 'RNSplashScreen.h' file not found, you have to select your project → Build Settings → Search Paths → Header Search Paths to add:

   $(SRCROOT)/../node_modules/react-native-splash-screen/ios



 Third step(Plugin Configuration):

Android:

Update the MainActivity.java to use react-native-splash-screen via the following changes:

java
import android.os.Bundle; // here
import com.facebook.react.ReactActivity;
// react-native-splash-screen = 0.3.1
import org.devio.rn.splashscreen.SplashScreen; // here
// react-native-splash-screen 
import 
import "RNSplashScreen.h"  // here

@implementation AppDelegate

- (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions
{
    // ...other code

    [RNSplashScreen show];  // here
    // or
    //[RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView];
    return YES;
}

@end



 Getting started  

Import react-native-splash-screen in your JS file.

import SplashScreen from 'react-native-splash-screen'    

 Android:

Create a file called launch_screen.xml in app/src/main/res/layout (create the layout-folder i

Top issues

Latest release

v3.3.0 v3.3.0 2021-12-11

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON