Search code examples
ioscollectionview

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


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: enter image description here

from simulator: enter image description here


Solution

  • 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.