How to Optimize Layout for Different iOS Screen Sizes

|
| By Webner

We were stuck on a problem with new auto layout interface while trying to adjust contents within the screen but changing the property for a single element was disturbing whole layout. Optimized layout was working only for one device for which we were testing the change in properties. For other iOS devices with different screen sizes, alignment was awkward.

To fix this, first thing we did was to remove all the auto constraints from the view. Then we started adding constraints one element at a time starting from the parent view to the child view. This fixed the issue.

Another associated problem with this was that if two elements were aligned adjacent to each other (like two text fields for an email and a password) you cannot add constraints for them separately you have to add constraints for both relatively.


Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need iOS app development or any other software development assistance please contact us at webdevelopment@webners.com

Leave a Reply

Your email address will not be published. Required fields are marked *