Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dark mode launch screen in iOS 13

I've updated my iOS app to work in dark mode on iOS 13 but I am having trouble trying to get the launch screen to look good.

Currently it is a bright white screen with the app logo which looks awful in dark mode. I have tried setting the background colour of the launch screen to be a colour asset that I made with "Any Appearance" being white and "Dark Appearance" being black - but the launch screen still always shows as white.

Is there any way to get my launch screen to work properly in dark mode?

like image 590
Quinn Avatar asked Jul 04 '19 17:07

Quinn


People also ask

Is there Dark Mode on iOS 13?

On supported iPhone models, you can use Night mode to capture photos when the camera detects a low-light environment. You can use Night mode with iPhone 13, iPhone 13 mini, iPhone 13 Pro, iPhone 13 Pro Max, iPhone 12, iPhone 12 mini, iPhone 12 Pro, iPhone 12 Pro Max, iPhone 11, iPhone 11 Pro, and iPhone 11 Pro Max.

How do I activate Dark Mode?

Open your device's Settings app . Select Accessibility. Under "Display," turn on Dark theme.


2 Answers

When setting up the Launch Screen storyboard, set the view "Background" color to "System Background Color". This will be white in light mode and black in dark mode. No need to use your own color asset.

like image 65
rmaddy Avatar answered Sep 19 '22 09:09

rmaddy


I found a solution that supports earlier iOS versions as well as custom colors for each mode, dark and light, in iOS 13.

  1. Create an image asset, set Appearances to Any, Light, Dark, and load small solid pngs with your desired colors. In this case I am using orange for light, and black for dark.

image asset

  1. Go to your LanuchScreen.storyboard and add an image view with that image asset. Place the image behind your image logo, set Content Mode as Aspect Fill, and constrain the view to the Superview in all sides. (Make sure that your logo looks good with the two backgrounds, or set its Appearance too)

  2. This is where I had to do a trick. For some reason, I couldn't make the back image to show up. After checking some of the comments in Launch Screen storyboard not displaying image, I added the first image in the image asset to the target bundle

The color is static in older versions of iOS, and it works well with dark and light modes in iOS 13.

like image 24
Jose Santos Avatar answered Sep 20 '22 09:09

Jose Santos