1

I have an iOS App originally developed for iPhone 4 and 5.

After doing some updates, I tried to run it on iPhone 7 (Simulator), the Views won't fill the screen any more. They (inclusing the title bar) leave a black margin on the right and the bottom of the screen.

I found a lot of similar posts regarding iPhone 5, where an appropriate launch image was missing. Yet, I have included all possible launch images in their correct sizes as asset catalogue (shows no warnings any more, puh), and the when the app is launched, the launch image is fullscreen.

The Layout/View is set to auto-layout, and resized well, if I change the size in the InterfaceBuilder.

Why does the View not scale on iPhone 7 ?!?

BurninLeo
  • 4,240
  • 4
  • 39
  • 56
  • can you include a screenshot please? – ivanmoskalev May 07 '17 at 19:01
  • Okay ... after builing another launch screen image (320x568 seems not required any more), I created a new View and compared tab-by-tab. The solution was in the "Attributes inspector" tab of the View -> "Simulated metrics" -> "Size" was set to "Freeform". After changing this to "Inferred", the sizing worked. And so did the device selectors in the InterfaceBuilder. – BurninLeo May 07 '17 at 20:09
  • Could you please submit the solution you found as an answer to your own question and accept it? – ivanmoskalev May 08 '17 at 10:39

3 Answers3

1

Try to add splash screen image to project with following name instead of assets folder.

Default-568h.png                   320 x 568      
Default-568h@2x.png                640 x 1136  
Default-667h@2x.png                750 x 1334
Default-736h@3x.png                1242 x 2208
Default.png                        320 x 480
Default@2x.png                     640 x 960 
KKRocks
  • 8,222
  • 1
  • 18
  • 84
  • Thanks, but actually it wasn't the launch image this time. Strange thing with the images, though... I had uploaded no less than 12 images to cover all possible devices and resolutions. – BurninLeo May 07 '17 at 21:11
  • Why use all of these launch images? Just use a single launch screen storyboard. – rmaddy May 08 '17 at 01:16
  • @rmaddy i think this is bug . if you are add this image then your app launch with full screen according to image resolution. – KKRocks May 08 '17 at 02:31
  • @KKRocks You missed my point. Instead of dealing with launch images, just use a simple launch screen. It's so much simpler. – rmaddy May 08 '17 at 03:30
  • No, this one did not work for me (see edit in question). It was a different issue in my case. – BurninLeo May 08 '17 at 06:47
  • THIS DOES SOMETHING!! AMAZING! Can't believe getting resolution to show properly is question of supplying right resolution image.. – bobobobo Dec 25 '20 at 21:40
  • There is a better answer to this question [using launch screen storyboards here](https://stackoverflow.com/a/65499252/111307) – bobobobo Dec 29 '20 at 22:11
1

Found Solution

In the View's "Attributes inspector" tab, in category "Simulated metrics", the attribute "Size" was set to "Freeform". After changing this to "Inferred", the sizing worked.

Note, that this seeting shall be checked in the MainWindow, as well. And it may require a build-clean, before this change reaches the Simulator.

Changing the "Size" also influenced the device selector in the InterfaceBuilder (the symbols for different iPhone and iPad models), making it actually adjust the size when clicking an iPhone model or changing orientation... Before, nothing had changed when clicking a model from the selector.

BurninLeo
  • 4,240
  • 4
  • 39
  • 56
0

yes that was also working but in this question launchscreen are mentioned so i have gives answer according to that point.

KKRocks
  • 8,222
  • 1
  • 18
  • 84
  • Actually I mentioned that it was not the "often found" launch screen problem in my case :) Thank you, anyway. – BurninLeo May 08 '17 at 06:49