Collection view scaled on iPhone 6s (only real device) - ios

I have three collection views with flow layout. The first and second have always the same height and cell sizes. The third one and the distance between them will be scaled for the different iPhone sizes.
In the different simulators everything works great.
On my iPhone X everything ok.
On three other real devices from external tester everything ok.
(iPhone 7, iPhone 7+, iPhone 8+)
And now I have one external tester with an iPhone 6s. He sent me a screenshot and it looks like, that everything is scaled/zoomed/blown up. (even the buttons) I can see that he has activated "button shapes" from the accessibility features, but I can't replicate that error.
Does someone has an idea, what this could be?
from tester:
from simulator:

The problem is that in your code you are basing the size of your interface objects on the type of device. Thus you are making a false assumption that if you know the device type you know the screen dimensions. That's wrong. You need to base them on the actual dimensions of the screen.
The reason is that devices like the iPhone 6s can have different virtual screen dimensions depending on whether the user has the device in standard or zoomed display mode.

Related

Swift | View sizes and fonts are different in different screen sizes

I have a big application with many screens. All of a sudden, every new screen I create has different sizes depending on the iPhone.
For example, I develop the app on an iPhone 12 Mini simulator and everything looks great. But, when I run the app on a physical iPhone XR, every button, every image, and every label is significantly smaller!
Everything has a static size. Eg a button with a static size of (80, 30). Note, that not every screen has this issue.
Any idea on what's going on?

How to adjust values in Xcode to depend on device played (iPhone vs. iPad)

I am currently making a classic snake game app.
The app fits and works on all iPhones however when I test on any iPad the lettering is off the screen and so is the game screen.
Is there anyway to adjust the proportion or have it depend on what device you are using?
I was unable to find much help online when looking for this question. (first image is an iPhone 7, and the second is an iPad Air 2.
What you're looking for is Adaptive User Interfaces. You should be able to have different layouts for different device sizes using a single storyboard.
You can also change values programatically in your code according to the screen size.

Device Layout Does Not match Simulator or Storyboard

I've been away from Xcode for a while, so I may have missed changes in the latest couple of releases. The layout of views looks identical in the Storyboard, and on the simulators (iPhone6 and iPhone7), but different on my iPhone 6. I have no warnings or errors in the Storyboard, and I am using Xcode 8. The device acts as if it had a shorter screen than the simulator -- things that are spread appropriately on the storyboard or simulator, are squeezed together vertically on my phone. What is the reason for this difference?
Have you assigned launch images with the correct dimensions for the different form factors? An easy way to verify this is to add a print statement in a view controller to see what the bounds are for the screen. Verify that these values match what you expect for the device.
The following from Apple documents this:
Because device screen sizes vary, launch screen sizes vary too. To
accommodate this, you can provide a launch screen as an Xcode
storyboard or as a set of static images for the devices your app
supports. Using an Xcode storyboard is the recommended approach, as
storyboards are flexible and adaptable.
While not an official Apple site, this link also references this as a potential issue:
The launch XIB or storyboard is required to support iPhone 6 sized
apps.
Another possibility is that you have the screen zoomed in on the device. To change this, go to Settings > Display & Brightness and select Display Zoom at the bottom. Ensure that you have Standard selected. If you are zoomed in, then the device will scale down (A 6 behaves like an SE, a Plus behaves like a 6/7).

Removing launch screen file from Info.plist scales the views

I noticed something that when you remove the launch screen file entry from the XCode Info.plist file, any view of any view controller becomes scaled according to the screen size, so the views appear zoomed in on large screen sizes such as the iPad Pro (12.9 inches) and appear somehow zoomed out on smaller devices (iPad Pro 9.7 inches).
In that case it seems that the Auto Layout constraints have no effect as the scaling is done automatically.
I really can't understand what does this has to do with the layout constraints, so I appreciate if any one can explain what's the reason for that.
Without being able to provide deep details, iOS uses the launch screen definition (view or static images) to determine which size classes the app should use. If you have not supplied those, it seems you get scaling that you generally do not want.
That doesn't mean auto-layout no longer has any affect... it just means that the auto-layout engine is not using the current screen size for its size/positioning calculations.
You'll see very similar results if you explicitly set your project for iPhone only.
Simple, obvious solution: Don't remove the launch screen.
Yes this is expected behaviour... Same is for iPhone 6 Plus. If you remove the iPhone 6 Plus launch screen, it will display the iPhone 6 scaled version.
This is just for backward compatibility. If your app is not ready for iPad Pro or iPhone 6+, scaled version can be used by removing the respective splashing screens.
All current iPhone apps or iPad apps in AppStore those are not optimised runs as a scaled version.

Always hide iPhone/iPad graphic bezel from iOS Simulator?

If you build to a simulator with dimensions too large to fit on your screen, it'll throw it into a nice, neat little regular OS window, rather than the "Oh look, it's an iPhone on my screen!" thingy.
I'd like it to always do that, even with a non-retina phone whose dimensions can fit on my display. I don't ever want to see the graphic bezel around the outside.
Is that possible?
To not show the graphic bezel either change the iOS Simulator device under hardware -> device to iPhone Retina 3.5 inch or iPhone Retina 4 inch. Another solution is you can keep the "iPhone" device setting and change the window scale. Either of these will remove the bezel.

Resources