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:
- When in portrait (with no need for scrolling) the view still wants to scroll.
- When in landscape, it leaves too much scrolling space at the bottom.
Constraints:
- ScrollView - Trailing/Leading space to superView, Bottom space to label2, Top space to label1
- ContentView - Trailing/Leading/Bottom/Top space to superView, Width equal to mainView
- Label1 - Align Center X, Top space to superView (60), Bottom space to scrollView
- Label2 - Align Center X, Bottom space to superView (60), Top space to scrollView
- Buttons - Align Center X, Top space to superView (50), Height equals (50), Bottom space to other button (30) or Bottom space to superView (50)
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 -_-
Height equal to superView (priority 250)
. Not sure why that's there. - Mihai Fratu