I'm trying to use auto layout for positioning the following views inside a viewController that may have different sizes on different devices:
All of the UILabels should have fixed space from the top or bottom and between them. The UIImageView should have flexible width and height according to the space that left, and a 1:1 aspect ratio.
The UILabels have the following constraints:
- Top space
- Bottom space
- Horizontal center in container
The UIImage view has the following constraints:
- Horizontal center in container
- 1:1 ratio
- Bottom space to label
- Top space to label
- Width: 100 (priority 250)
- Height: 100 (priority 250)
In the Xcode preview everything looks good, but when running the app the UIImage covers the entire screen instead of adjusting its width and height correctly.