ZNApps ZNApps - 3 days ago 4
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

4s

iPhone 4s




7 or 7s+ (Fail)

enter image description here




7 or 7s+ (I hope this)

7 or 7s+ (I hope this)

Answer

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

Comments