Dark mode launch screen in iOS 13

后端 未结 5 482
故里飘歌
故里飘歌 2020-12-30 19:10

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 w

5条回答
  •  爱一瞬间的悲伤
    2020-12-30 19:46

    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.

    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.

提交回复
热议问题