Setting launch screen image through info.plist - image stretches to cover full screen

I am developing an app in swiftUI using Xcode 12.3, deployment target iOS 14.0. The launch screen is setup through info.plist by specifying 'background color' and 'image name'. The file used in 'image name' is from Assets catalog. (PNG format, size300 x 300 and corresponding @2x and @3x resolutions) What I have observed, when the app is installed for the first time the launch image is centered and have original resolutions but all subsequent launches show launch images stretched to cover full screen. Any ideas why this is happening and how to have more consistent behavior either way?

I have tried 'respect safe area' option but it does not make a difference.

Thank you.
Post not yet marked as solved Up vote post of pkan Down vote post of pkan
7.5k views

Replies

Hi. Are you using an emulator? because I observe the same behavior that you do on my emulator. But if I use the real device, then everything is fine.
Thank you for your reply. I see this happening on device as well :(
this is my info.plist for one of my app on SwiftUI:

Code Block language
<key>UILaunchScreen</key>
<dict>
<key>UIColorName</key>
<string>onboarding_color</string>
<key>UIImageName</key>
<string>onboarding_logo</string>
<key>UIImageRespectsSafeAreaInsets</key>
<false/>
</dict>


and my onboarding_logo is svg file.
Happens more often on simulator than device, but does reproduce occasionally on device

I'm having this same exact problem in Simulator, as well as physical device.

THIS is a really bad bug that needs to be fixed ASAP. I don't understand why this hasn't been fixed already considering the number of people asking about it.

HOLY SCHNIKES! FIX IT!

I hate to say this, but I believe this skewing happens if you only include one of the 1x.2x,3x and it does a really BAD, like bad bad, like no one cares job at resizing it by just stretching it to the available space.

I DO NOT want to add that extra 500K because that is 5% of my total app size budget for App Clip.

Even with 1x,2x,3x images it still skews. So, make it stop. Or not. I'm just here coding.

Same issue. Have tried nearly every hack out there. Nothing works. Image distorts. Refuse to use a storyboard. Apple has $100B+ in the bank. They can get on this.

2023 and this is still broken... bugs like this make it hard to consider SwiftUI a viable option.

https://stackoverflow.com/questions/65785025/launch-screen-image-stretches-in-swiftui Using the storyboard launchscreen described in the link worked for me