当放置大图像时,UIImageView图像扭曲 [英] UIImageView image distorts when big image is placed

查看:136
本文介绍了当放置大图像时,UIImageView图像扭曲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在UIImageView中设置大图像时,图像的分辨率会扭曲。

While trying to set a big image in UIImageView the resolution of the image distorts. Is there any way to keep the image in same resolution while fitting it in a smaller view?

推荐答案

尝试将imageview内容模式设置为aspectfit。

try setting imageview content mode to aspectfit.

imageView.contentMode = UIViewContentModeScaleAspectFit;

这篇关于当放置大图像时,UIImageView图像扭曲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆