Reputation: 893
I'm trying to get some subviews inside of a view inside of a scroll view to extend the width of the view minus 16px margin on either side. I have no width constraint set, only height constraint, vertical spacing constraint, and leading/trailing spacing constraint. This exactly same procedure worked on a different view but in this new view auto layout is not maintaining 16px spacing for the trailing space constraint. Below is a screenshot of what is happening:
As you can see, even though there's a 16px trailing constraint, when I update frames and/or run the app, the register button just snaps all the way back to a 194.5px trailing space. I don't believe I have a relative margin set but I'm not certain.
Any help is greatly appreciated.
Upvotes: 0
Views: 315
Reputation: 3199
Your image states that you have some sort of misplaced view. The orange line states that this isn't what will actually be rendered, but the (+194.5) one. Please try to do the following steps and see if it helps.
Before:
The misplaced view:
After I update frame:
Did you try to do these steps? If it doesn't help, post an image after you click 'update fames' Thanks
Upvotes: 0