Reputation: 45
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.
However, when I run the simulation, 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
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
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.
After that select your stacked view and add constraints to Landing, trailing, top, and bottom.
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
don't forget to add Equal width and Equal height constraints
after you do everything your views will be the same for every iPhone
Upvotes: 2