gpt4 book ai didi

iphone - 缩放后如何在 imageView 中调整图像大小?

转载 作者:行者123 更新时间:2023-11-29 11:11:31 26 4
gpt4 key购买 nike

目标:缩放后。在 scrollView 中调整图像大小?

我在 scrollView 中有一个 imageView。缩放图像后,当我通过 imagePicker 在 imageView 中放置另一个图像时,它已经缩放了。我希望当我在 imageView 中选择另一张适合屏幕的图像时。我尝试了一些代码

        CGSize scrollSize = scroll.frame.size;
[scroll setContentSize:scrollSize];
imageView.contentMode = UIViewContentModeScaleToFill;

但这对我不起作用。

谢谢

第一张图片enter image description here

放大后的图像是enter image description here

当我再次通过 imagePicker 选取图像时图像是 enter image description here

最佳答案

关于iphone - 缩放后如何在 imageView 中调整图像大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11356393/

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