需要有关UIImageView的contentMode和autoresizingMask的帮助 [英] Need help about contentMode and autoresizingMask of UIImageView

查看:67
本文介绍了需要有关UIImageView的contentMode和autoresizingMask的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

i have picture like this image it will present on Landscape Mode

因此,如果将设备旋转到人像,如何呈现这样的图像

so if rotate device to Portrait, how to present image like this

推荐答案

使用具有以下设置的UIImageView:

Use an UIImageView with these settings:

imageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
                              UIViewAutoresizingFlexibleHeight);

imageView.contentMode = UIViewContentModeScaleAspectFit;

这篇关于需要有关UIImageView的contentMode和autoresizingMask的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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