I have a ScrollView with vertical scrolling. The reason for the ScrollView is to fit all of my buttons when the orientation changes to landscape.
There are 2 problems that are possibly linked:
Constraints:
Adjust Scroll View Insets is unchecked. Its all in autolayout, no code.
View Controller Example:
What's strange, is that I have other perfectly working scroll views that resize accordingly. When trying to duplicate the process, I kept getting the same results...
Looked around, but haven't been able to find any helpful answers. So any help would be greatly appreciated.
I'll add other information if needed. I'm sure its a simple solution that I keep overlooking -_-
Anchor scroll view leading and width to view's leading and width; anchor top to label1 bottom and bottom to label2 top.
Get rid of the content view (not needed). Add everything to the scroll view.
Anchor button1 center-x to scroll view center-x and top to scroll view top. If you need to give button1 width or height using constraints, do not use the scroll view's width or height; instead, anchor the button's width to the view's width, height to view's height. Subviews of scroll view should not rely on the scroll view to determine their sizes.
Anchor button4 top to button3 bottom, center-x to scroll view center-x; and most importantly, anchor button4 bottom to scroll view bottom (this will stretch the scroll view for you). This will prevent scrolling when scrolling isn't needed.