Dark mode launch screen in iOS 13

后端 未结 5 457
故里飘歌
故里飘歌 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:37

    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.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-30 19:49

    Yes Launch Screen work in dark mode, First check the background colour of your "xyz" image. if it is ok. just delete you app from device or simulator, because some time Launch Screen cached by device or simulator and you will not get the update UI on it. if you will face same problem just follow my demo app github.com/Indolia/darkmode.git

    0 讨论(0)
  • 2020-12-30 19:52

    I was missing colors from my color palette in Xcode defaulty offered colors so I created my own using Color.xcassets where I created custom color set with appearences Any, Dark and set my colors.

    Then I can use them in autolayout same like System Colors even in LaunchScreen

    0 讨论(0)
  • 2020-12-30 19:53

    I was updating my app to support new Dark Mode for iOS 13, I put "System Background Color" for the View's background in my LanuchScreen.storyboard, but surprisingly it didn't work!

    The Logo image on the page was changing correctly based on Light/Dark Mode, but not the background!

    I was about to apply Jose's solution, but before that, I decided to completely remove the app from my device and try again. And it worked!!

    0 讨论(0)
提交回复
热议问题