I have an UIViewController with four subviews its look like below picture first subview is 50% of the screen and remaining three subviews occupy the remaining 50% of the view.In the bottom first 25% its will occupy the 2:1 ratio range.remains are occupy by 25% of the view.it's will be positioning the ipad landscape view properly but in portrait view first view more than 70% occupy. how to resolve this
相关问题
- UITableViewCell layout not updating until cell is
- Unable to change UISearchBar cancel button title c
- UIModalTransitionStyleFlipHorizontal flips Vertica
- iOS autolayout - gap between image and top of the
- Begin UIPanGesture Event From A Pressed State At T
相关文章
- Why are my UIView layer properties not being set w
- How to set different navigationbar color for diffe
- How to show the keyboard for a UIView
- UIView subclass draws background despite completel
- Using the device simulator for iOS 8 with Xcode 7
- How to open Photo app from UIViewController?
- Rotate (angle) a UIView, using User Defined Runtim
- Custom transition animation unknown delay between
I've created the setup according to what you want. Please check the below screenshots.
Here are the steps to create this setup:
1. Add the four views into the main view.
2. Add leading, top and trailing space constraints from the brown view to the main view.
3. Add vertical spacing and leading constraints from the purple view to the brown view.
4. Add vertical spacing, trailing and equal heights constraints from the green view to the brown view.
5. Add bottom space constraint from the green view to the main view.
6. Add horizontal spacing and equal widths constraints from the purple view to the green view.
7. Add vertical spacing, leading, trailing and equal heights constraint from the orange view to the purple view. Change the multiplier value of this equal heights constraint from 1 to 0.5 in the size inspector (See the last screenshot).
8. Add bottom constraint from the orange view to the green view.
1. Views in Storyboard:
2. View Hierarchy and Constraints:
3. iPad Screenshot in Portrait:
4. iPad Screenshot in Landscape:
5. Size Inspector: