gpt4 book ai didi

iphone - 需要有关 UIImageView 的 contentMode 和 autoresizingMask 的帮助

转载 作者:行者123 更新时间:2023-12-03 18:37:27 31 4
gpt4 key购买 nike

我有这样的图片,它将在横向模式下呈现

alt text

如果将设备旋转为纵向,如何呈现这样的图像

alt text

最佳答案

使用具有以下设置的 UIImageView:

imageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight);

imageView.contentMode = UIViewContentModeScaleAspectFit;

关于iphone - 需要有关 UIImageView 的 contentMode 和 autoresizingMask 的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2963231/

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