1
votes

I am trying to improve my app to looks the same on every iPhone device. I started designing on iPhone 8 plus. I added 3 buttons to the view and set 3 constraints(width/height and aspect ratio) 1st button = Width:300 Height: 65 aspect ratio 2nd button = Width: 175 Height: 65 aspect ratio 3rd button = Width: 200 Height: 65 aspect ratio

I added them to stackView and set some options(axis: vertical , alignment: center ,distribution: fill proportionally, spacing: 19) Now i want to set the stackView so it will looks exactly the same on every device.my storyboard. When i add 3 constraints (top/right/left + aspect ratio) i dont get the results i want. Any idea what i am doing wrong?

1
did you set the constraints of stack view? - Wings
Yes , for example i set top:0 , left:50 ,right:50 and aspect ratio , and it looks different on every iphone device - ShadeToD

1 Answers

1
votes

Set stackView distribution = FillEqually , then when you give stackView these constraints

top , left , right and aspect ratio

any item will have it's height resized , and give each one the aspect you want so the width will stretch accordingly