Views in ScrollView doesn't respect constraints

319 Views Asked by At

I added a ScrollView to my View Controller. Then, I created constraints between my inner elements and the scroll view itself, but I don't understand why my yellow view for example is not taking the full width.

Here is the screenshot of my view and constraints:

enter image description here

And sometimes I get this, why?

enter image description here

When I don't use Scroll View, all works perfectly.

1

There are 1 best solutions below

3
On BEST ANSWER

Control drag from the mapView to the outer main View and select Equal-Widths