Ravi Sisodia
Ravi Sisodia

Reputation: 776

iOS: Image scaling using auto layout in Storyboard

I have a launch screen with a image at bottom right corner. Constraints are as follows:

  1. Width: Width of UIImageView must be one fourth of superview.
  2. Left: Left margin is zero with superview
  3. Bottom: Bottom margin is zero with superview

and also mode for imageview is set to Aspect Fit.

What should be the height constraint, so that the image in the UIImageView is bottom aligned for all devices and all orientations.

6S Plus landscape

6s Plus portrait

In the screenshots, the image is not bottom aligned, although the imageview is.

enter image description here

Upvotes: 0

Views: 817

Answers (1)

Ravi Sisodia
Ravi Sisodia

Reputation: 776

So the solution to my problem is Aspect Ratio constraint, with all the constraints in question.

Upvotes: 2

Related Questions