Reputation: 867
Here is my problem. I have this storyboard :
The first container must have a fixed height. It is related to the DetailFormViewController with the switch. I do not want it to be scrollable.
The second container must have a dynamic height, i.e. take the available height. It will show uitableview.
Here what I have on iPhone 6 : and on iPhone 5S :
.
I have 3 questions :
Thank you for all your answers.
Upvotes: 1
Views: 1530
Reputation: 2778
For making the top container height to be fixed and the bottom container to be flexible. To keep only 4 rows in top container, set the top container height constraint value as equal to 4cells height(4 * cell height).
You need to add constraints on two containers as like follows:
I have named first container as Top Container View and 2nd container as Bottom Container View.
Top Container View constraints:
- Top Space to Top Layout Guide
- Leading Space to container
- Trailing Space to container
- Vertical Space to Bottom Container View
- Height
Bottom Container View constraints:
- Bottom Space to Bottom Layout Guide
- Leading Space to container
- Trailing Space to container
Constraints are mentioned in this figure:
Setting the height of the Top Container View defines that the top view height is fixed and the Bottom Container View's height becomes flexible.
iPhone 4s Portrait:
iPhone 4S Landscape:
iPhone 5S Portrait:
iPhone 5S Landscape:
Upvotes: 2
Reputation: 9414
More than likely you have Adjust Scroll View Insets enabled in your view controller.
Upvotes: 0