The application runs in full screen mode in the simulator, but not on the device

This is an Xcode 6 Swift project. When you select iPhone 5 or 5 in the simulator, the application starts at full screen height. However, when launching the application on a real device (iPhone 5s), only iPhone 4 is displayed on the screen (i.e. Black bars are displayed at the top and bottom of the screen).

It is strange that I recreated this project from another test project - and in the original project I did not have this problem.

I did a text comparison in the storyboard xml files for each, and both of them are basically identical. I also looked at the build settings for each and see no obvious differences. Finally, the json files specified in the Images.xcassets directory are the same for each.

+6
source share
4 answers

I managed to solve the problem. In the "General Settings for the Goal" section of "Application Icons and Launching Images" I clicked on the "Use Object Directory" button and performed the following settings.

App Icons and Launch Images screenshot

+21
source

Place the startup screen images for iphone 5 and iphone 4. Set the default image size to 568 @ 2x as 640 x 1136.

You may have missed this splash screen size in your project.

+2
source

This was fixed for me after adding images of all sizes

0
source

For me it was because I saved the file in photoshop format, but with the PNG extension. The emulator downloaded the file, but the actual device could not. The lost 3 hours fiddled with asset catalogs before I realized this!

Related Blog Post

0
source

Source: https://habr.com/ru/post/973871/


All Articles