简体   繁体   English

iOS约束。 如何通过约束将图像视高比设置为等于图像比?

[英]iOS Constraints. How to set image view height ration equal to image ratio by constraints?

I've image view with equal width constraint and aspect fit. 我有相等宽度限制和宽高比适合的图像视图。 I need to resize height to the same ration that image has by using constraints is it possible? 我需要通过使用约束将高度调整为与图像相同的比例,这可能吗?

Is now: 就是现在:

在此处输入图片说明

I need something like: 我需要类似的东西:

在此处输入图片说明

Use aspect ratio and it will resize using the same proportion for both width and height 使用宽高比,宽度和高度将使用相同的比例进行调整

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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