I have an input page with labels and buttons that is too long to fit on the screen of any of the iPhones. I want to let the user scroll vertically to make all the inputs.
I'd like to do the layout in storyboard.
All the suggested answers I can find either deal with different situations: - Layout all by code - Content is images which have an inherent size - May work with autolayout/xcode 5 but I can't make work for adaptive layout and xcode6
Here's visually what I am talking about. The yellow box is the view that holds the input elements. The black box represents what can be seen at any time.
Here's what I have tried, based on my research:
- Added a ScrollView inside the main view that completely fills it. (This should be the black rectangle, I think.)
- Added a View (to act as content container) inside the scrollview. (The yellow rectangle)
- Added the elements needed to the content view. To go below what is visible on the screen, I dragged and extended the View so it is large enough to contain everything.
- Added constraints pinning the content view to the scrollview on all sides.
- Added constraints making the content view the same width and height as the top level view.
- Added constraints to the width and height of all the elements and from their sides to the sides of the container view.
What I get in the simulator: Just the elements that can fit within the original screen size.
Can anyone help solve what I feel like must be a common problem?
Thanks.