UIView中的UIImageView而不显示超出范围的图像部分 [英] UIImageView in UIView and not to display image parts out of bounds

查看:614
本文介绍了UIView中的UIImageView而不显示超出范围的图像部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决标题中提到的问题? 所以我有一个UIImageView并且其中有一个UIImage. 我的UIImageView在视图中.当我将imageview的原点设置为(-120,-30)时,我不想看到我的imageview的开始.这可能吗?能做到吗?怎么样?

How can I solve the problem I mentioned in the title? So I have an UIImageView and in it there is an UIImage. My UIImageView is in a View. When I set the origin of the imageview to (-120, -30) then I don't want to see the start of my imageview. Is this possible? Can this be done? How?

推荐答案

将图像视图上的clipsToBounds属性设置为YES.

Set the clipsToBounds property on the image view to YES.

这篇关于UIView中的UIImageView而不显示超出范围的图像部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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