I'm running into a strange AutoLayout related issue when I use a UIScrollView
(the issue does not occur without it).
I have a UIScrollView
that is constrained to the boundaries of a UIView
(contained within a UIViewController
), and within that, I am attempting to place a UILabel
and UITextField
side by side. I have constrained the UILabel
to the left and upper boundaries, with it's width and height constrained (see screenshot below):
Right next to this UILabel
is a UITextField
, which is constrained to the left, top, and right, as well as having the height constrained. However, this results in a "Misplaced Views" warning, that states "Expected width = 163
, Actual width = 413
", shown in the screenshot below:
When I choose to "Reset to Suggested Constraints", the "Misplaced Views" issue disappears, but in it's place I am left with a width
constraint of 413 points, which is something I'm hoping to avoid, as I would not like this UIViewController
to be horizontally scrollable on smaller devices.