I'm facing the same issue https://github.com/crazycodeboy/react-native-splash-screen/issues/338#issue-389809278 @sergiulucaci's solution makes the app to start after some delay. https://www.youtube.com/watch?v=rnLR65OGtic i try this solution i can't apply my splash design because he is using layer-list instead of layout. Any other solution?
I had the same issue. I just added android:windowIsTranslucent and android:colorBackground on styles.xml. Hope this works for you.
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:colorBackground">@color/primary_dark</item> <!--Change for the color you want -->
</style>
forgot to post where I found the solution:
In file res/layout/lauch_screen.xml add android:background="#ffffff" in tag RelativeLayout
Example:
<RelativeLayout
...
android:layout_height="match_parent"
android:background="#ffffff">
</RelativeLayout>
I have created a SplashActivity
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
finish();
}
}
and in AndroidManifest.xml
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:theme="@style/SplashTheme"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
SplashTheme is basic
<style name="SplashTheme" parent="AppTheme">
<!-- Customize your theme here. -->
<item name="android:windowIsTranslucent">true</item>
</style>
@martianatwork if you use android:windowIsTranslucent and react-native-orientation-locker together it breaks react-native-orientation-locker and Android 8.0 and above.
For me what worked was this tutorial https://codingambitions.com/reactnative/how-to-add-splash-screen-in-react-native-app-for-android/
Adding
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowDisablePreview">true</item>
</style>
Most helpful comment
I had the same issue. I just added android:windowIsTranslucent and android:colorBackground on styles.xml. Hope this works for you.
forgot to post where I found the solution:
https://stackoverflow.com/a/30343050