This is a fresh project created under the Game template in newest version of Xcode. The view is acting really weird, look at the image:
Of course, there’s no constraints. If I add alignment constraints and align it correctly to horizontal and vertical center, it’s aligned correctly. When normal constraints are added for each side, I get Unable to simultaneously satisfy constraints.
My main problem is however these black borders. Why do they appear? (Have tried iPhone 12, 11 and SE 2 emulators)
2
Answers
The Game template does not include a
LaunchScreen.storyboard
— no idea why.If you add one to your project and set it in the project settings:
You’ll have a full-screen view as expected.
I was just having this exact issue, but instead of using UIKit and Storyboard, I’m using SwiftUI (Xcode 14.1 and iOS 16). @DonMag’s answer is still roughly the solution, but the project settings you have to adjust are slightly different with SwiftUI. Under Build Settings, set the
Launch Screen (Generation)
plist key to "Yes".