KirillC KirillC - 1 year ago 121
Swift Question

Update UI constraints in Xcode 8 for a specific device

As you can see on the image below my View Controller is packed with labels, everything looks good on iPhone SE but not on a larger screen phone. Is it possible to increase space between UI elements on iPhone 6,7,+ but keep same on SE without implementing Scroll View?

enter image description here

Answer Source

You can use Stack View, it will automatically set space for every device. Embed labels in stack view (Editor -> Embed In -> Stack View) and choose Distribution property that works for you ("Fill Equally" or maybe "Equal Spacing"). You can embed any view - also stack view (so you can have 12 stack views with label and result and embed them in external stack view for proper row spacing).

iPhone SE iPhone 7 Plus

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download