简体   繁体   中英

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景观

6s Plus人像

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

在此处输入图片说明

因此,解决我的问题的方法是Aspect Ratio约束,并考虑所有约束。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM