Chewie The Chorkie
Chewie The Chorkie

Reputation: 5234

I can't get buttons to align correctly for different devices in the Storyboard Editor

I've tried a thousand different things, wasting days never getting it right. I'm attempting to use a UIStackView to hopefully relieve all these problems, but nope, the Storyboard Editor still proves itself to be horribly designed and broken.

My main concern are the buttons down at the bottom being viewed on an iPhone 8 Plus. I'd like them evenly spaced for any device, but I haven't figured that out without them going outside the bounds of other phones. They are in a UIStackView.

story board view

My Size Inspector for the UIStackView with constraints:

UIStackView Size Inspector with Constraints

Running this on my device (iPhone 6s Plus) does not look like this at all. The buttons do not show up. Somehow it messed up my UIPickerView to show like it is there which I had customized programmatically to scroll sideways which is now somehow being ignored. I hope I have enough undo levels to get it back to at least where it used to be.

All I want in the end is the bottom horizontally placed buttons to be placed evenly there, with even spacing on every device. How?

Upvotes: 0

Views: 25

Answers (1)

Britto Thomas
Britto Thomas

Reputation: 2120

Instead of stack view you can use just UIView with clear colour to adjust your constraints. Just like this

enter image description here

Preview in 8+ , 8 , SE

enter image description here

Upvotes: 1

Related Questions