UIScrollView Content View ignores width constraint on Xcode 6 main view

I added a scroll that contains a content view. The scrollview constraints keep it just below my progress bar and are tied to the master, trailing file and the bottom of the supervisor. Content viewing constraints keep it at the sides of the scroll, with one additional constraint: equal to the width of the supervisor.

Everything looks fine on the storyboard preview, but the scroll width increases at runtime.

simulator

Basically, it seems like AutoLayout ignores my constraint to limit the width of the content view, and instead just lets the content view get as much as it wants to fit the content.

Here are my limitations:

xcode 1

Thank you for helping me get through this checkpoint! I knocked my head against the wall for several days.

+3


source to share


1 answer


Here are some things I would like to try. I have no comments yet, otherwise I would ask for clarification:

  • Are there any outputs in the console for Xcode? Usually, when Autolayout enforces a constraint violation, it reports it in the logs.
  • So, for presenting content, do you have a constraint that sets the width to the ScrollView, as well as constraints to match the Leading and Trailing edge with the ScrollView?


If the constraint is not met, then either the ScrollView also expands in some way, or the constraint conflicts with another constraint and the width constraint intersects somewhere along the way.

+5


source







All Articles