I am using AutoLayout in my sample app. I have three views, topView, middleView, bottomView.Following are the constraint I need,
topView:
- Always start at x origin 10.
- Left and right margin 10.
- Height should vary based on screen bounds(or superview).
middleView:
- There should be 10 px vertical margin between top and middle view.
- Left and right margin 10.
- Height should vary based on screen bounds(or superview).
bottomView:
- There should be 10 px vertical margin between middle and bottom view.
- Left and right margin 10.
- Height should be constant, say 30.
I want that based on device screen size, bottom view y origin should change so that middle and top view size will adjust. Problem here is there is no way to find out, what should be the y origin of bottom view and interface is providing permanent constraint like:
- Top space to superview for middle view.
- Top space to superview for bottom view.
This is because there is no way to find out the height of views. Only difficulty is determining height for top and middle view.