I'm hoping I can get some help explaining why this is happening. I have been working on switching my app I've been learning / building from UIKit to SwitfUI since this seems to be the future... plus it's fun to learn.
I've got my plist setup with the background and image
And the very first time I run it when the simulator opens or I clear and erase the simulator is this:
However, every time after I run the app, the image stretches.
When I try it on my phone, it seems to stretch every time. I'm not sure what is happening here. Is it just that SwiftUI needs more work or is there a setting I'm missing?
If your project doesn't contain a default launch screen file, add a launch screen file and set the launch screen file for the target in the project editor. Choose File > New > File. Under User Interface, select Launch Screen, and click Next.
It's the replacement for launch images. The main storyboard is what your app actually displays when the app is running. It contains your app, code, and logic. Follow this answer to receive notifications.
Resize your image to @1x, @2x, and @3x versions when @1x is 200x200px.
Then upload it to Assets folder and change info.plist Image Name
.
This worked for me.
This seems to be a SwiftUI Bug, which still isn't fixed. The only way to go around this bug is to go back to storyboards.
As described in this blog post, you have to create a launch screen storyboard and link it to your project.
To do so:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With