ZNApps ZNApps - 1 year ago 73
iOS Question

iOS auto layout 3 blocks in the center screen

I have a layout like picture. This is design in 4s, when I run in 7 or 7s+, I want 3 white blocks is center as 4s and increase size to match with new screen. Any help? I use Xcode 8.1. Thanks


iPhone 4s

7 or 7s+ (Fail)

enter image description here

7 or 7s+ (I hope this)

7 or 7s+ (I hope this)

Answer Source

Place your 3 blocks into a horizontal stack view (UIStackView) with the desired spacing, and then center the stack view into your content view.

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