iPhone SE Autolayout

I am making an app where for iPhone 6 and higher everything looks fine. (Note: I designed app in iphone 6 size in storyboard)


But when I test on the SE everything is on top of each of and looks really bad.


I don't know how to make it look good on the iPhone SE without ruining everything else.


If there is a way to make the app not support SE's then I am open to that.


Thanks!

Accepted Reply

>If there is a way to make the app not support SE's


Apple expects devs to build for certain iOS versions, not principally devices, so...


Supporting multiple screen sizes can be non-trivial. In your example, see this SO thread for starters:


https://stackoverflow.com/questions/48593709/xcode-problems-with-autolayout-for-iphone-se-size-screenshttps://stackoverflow.com/questions/48593709/xcode-problems-with-autolayout-for-iphone-se-size-screens


Otherwise, it might help if you could better descrbe "looks really bad"

Replies

>If there is a way to make the app not support SE's


Apple expects devs to build for certain iOS versions, not principally devices, so...


Supporting multiple screen sizes can be non-trivial. In your example, see this SO thread for starters:


https://stackoverflow.com/questions/48593709/xcode-problems-with-autolayout-for-iphone-se-size-screenshttps://stackoverflow.com/questions/48593709/xcode-problems-with-autolayout-for-iphone-se-size-screens


Otherwise, it might help if you could better descrbe "looks really bad"

You can select IOS version, but not forbid certain types of iPhones.


Are your views so busy on iPhne 6 that you cannot hold everything on SE ? Or is it that some UI elements fall out of screen ?


That is the purpose of auto layout to adapt automatically to the screen. Have you used it here ?


You have several options :

- use size class to create constraints depending on the class size of device

have a look here:

h ttps://www.raywenderlich.com/492-adaptive-layout-tutorial-in-ios-11-getting-started


- use traits variations (same article reference)


- or define constraints on iPhone 6 design ; create IBOutlets for those constraints that you need to reduce for SE.

In code, detect the type of iPhone (or probably just screen size) and modify the .constant of those constraints by multiplying by 0.9 for instance.