Search code examples
iosiphoneios-simulator

Xcode iPhone 14 simulator showing different results to real device


I have an iOS app, built recently using Swift, which is set to work in landscape mode.

I have had a few reports of dodgy display results on iPhone 14 (standard) and now I have looked at their screenshots, I can see what they mean but cannot replicate the problem in the simulator.

The problem, as shown in the illustration, is that I have my 'purple area' set to 500 and pink area set to cover the rest of the screen. On my simulator this works as is should and looks like the first image.

However, on a real device it looks like the second image with much more of the real estate used.

The Problem

It seems to be working well on all other devices but for some reason I am not getting the same view on what appears to be the standard iPhone 14 whether I view the Xcode storyboard or the simulator.

Could anyone explain why I am seeing such different results on one device? I have tried googling but nothing seems to answer the question.


Solution

  • An iPhone 14 is one of many devices that has a Display Zoom setting that can be toggled on:

    https://support.apple.com/guide/iphone/magnify-the-screen-iphd6804774e/ios

    This causes an absolute measurement such as 500 px to occupy considerably more of the screen. If your goal is to occupy a certain proportion of the screen, use an autolayout multiplier; do not rely on absolute numeric size values.

    (You cannot emulate this behavior on a simulator, because this feature is missing in Settings for the simulator. However, you can achieve the same virtual screen size just by simulating a smaller device, such as the iPhone 12 mini.)