Skii_club
Skii_club

Reputation: 45

Storyboard output not matching the simulation

Here is my desired output. Here is my desired output.

I've made sure that each view in my scroll view has been constrained and pinned equally to each side, as seen here. as seen here.

However, when I run the simulation, the views are slightly off to the left. the views are slightly off to the left. Why is this happening?

EDIT: I listened to what you guys said and got rid of the defined widths and heights, but now I'm getting another error.

Upvotes: 1

Views: 88

Answers (1)

Victor Lucas
Victor Lucas

Reputation: 217

In that case, a recommend you to put everything stacked in a StackView.

you can do it selecting your views and after that click on that "embed in" icon, and select StackView enter image description here

It will make easier to use manage left, right, top and bottom constraints.

After you click that probably all your views will get really close. And you will need to set spacing in the sidebar proprieties.

enter image description here

After that select your stacked view and add constraints to Landing, trailing, top, and bottom.

enter image description here

it will appear a red alert on your storyboard because you have not set the view's constraints relative to the stackedView, to do that, select all your views and click on Add Missing constraints at Select Views menu

enter image description here

don't forget to add Equal width and Equal height constraints

enter image description here

after you do everything your views will be the same for every iPhone

enter image description here

Upvotes: 2

Related Questions