Improving Gender Diversity In Cryptocurrency And Blockchain

This article was originally published by Oddup Co-founder and COO, Jackie Lam, on her LinkedIn profile. You can read the original article here. In one of my recent Forbes articles, I shed some light…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to add a Splash Screen on React Native and Expo

Splash screens are often used by large applications to tell the user that the application is still loading. An app normally has a startup time and can vary depending on whether it's a cold start(app starting from scratch for the first time), a warm start(app loading into the memory) or a hot start(bringing the app to the foreground). During this time, users don’t want to see a blank screen instead, they want the app to be responsive. Using a splash screen is a great way to cover this and tell your users that the app is still loading. Not to mention the fact that not adding a splash screen is just weird today.

Expo already has a default splash screen that does the job but it is really basic and doesn’t work if you want to show your app logo or name on the splash screen.

Expo’s default splash screen demo

As you can see, expo’s default splash screen is a simple static image with a white background and an outline to place your app logo in the center.

Expo’s splash screen

First, we will need a splash screen of our own. For the sake of this article, I’ve made a simple custom splash screen using Adobe Xd.

Custom splash screen

You can start by deleting the default icon and splash screen in the assets folder and replace them with your newly created custom splash screen and icon. Now the way to actually add the splash screen to your app is to edit the app.json file and add the following.

Notice the different options under "android.splash" and "ios.splash". Let’s start with resizeMode. To resize your splash screen so that it fits the resolution of the user’s device, resizeMode has two options "contain" and "cover". To understand quickly, "contain" maintains the original aspect ratio of the splash screen while "cover" tries to completely cover the screen. Most of the times, you want to go with resizeMode: "cover".

Your app.json should look like this.

Note: Make sure your images for the splash screen are in .pngformat and save them in the “assets” folder. Expo optimizes all the files in the “assets” folder when building the application.

Custom splash screen demo

Add a comment

Related posts:

The Reasons Why You Should Hire a Realtor

When it comes to buying your first new home, it would be best to make sure that you find a realtor first. Doing this is the best way to gain more insight in regards to the real estate market. Aside…

Dedicado a Sachiel

Hablando con un amigo, salió el tema de la energía del orgasmo, el amigo muy curioso me preguntó que qué era eso. Le dije que se lo explicaría “detalladamente”. Volvimos a coincidir en este vídeo en…

My top 11 productivity hacks in one year of Entrepreneurship.

If you are physically fit — you would bound to have tons of energy under your tank which will help big time in this journey. I do my weight training exercises in the morning before heading to the…