gpt4 book ai didi

ios - 如何使我的图像完全适合 UIView

转载 作者:行者123 更新时间:2023-12-01 18:39:56 24 4
gpt4 key购买 nike

我正在应用的图像在 iPhone7 plus 模拟器中看起来不错,而在 iPhone 5 模拟器中它不像我想要的那样。
我附上两张图片。请帮我。

enter image description here

第二张图片:

enter image description here

约束:

enter image description here

like this I want two images one over another

最佳答案

使用 Propotional Constraints 而不是给出 fix widh, heigth Constraints 。

假设您的 View 有 250 宽和 100 高,并且您正在设计 375 宽 xib 的单元格。

给予约束的步骤

1 :- Leading Constraints  same as you described in your image.
2 :- Center Vertical Constraints same as you described in your image.
3 :- Give aspect Ratio to your View.
4 :- Give equal width Constarint of Your View with Super View.

乘数计算:-> 250/375 = 0.6666666667

编辑最后一个名称应该是这样的Constarint: 比例宽度 ,编辑该Constarint并将乘数设为 0.6666666667

运行应用程序,如果您使用委托(delegate)方法设置适当的单元格高度,它应该几乎可以工作。

关于ios - 如何使我的图像完全适合 UIView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44845362/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com