当前位置: 动力学知识库 > 问答 > 编程问答 >

swift - Set size of UIImageView

问题描述:

I have a very simple question,

I am working in the storyboard and is dragging a uiimageview into the viewcontroller. I configure the imageview to be square (like 100*100). I now set the image to something that has another aspect ratio (like 100*150). When I build the app I expect the imageView to be square (100*100) as i have set in the constraints, but instead it shows the imageView with the image size. So in other words, what I am asking is: How can I set the imageView to the exact size I want so it overwrites the image size? Hope this makes sense, else I can try to explain it a bit better.

网友答案:

Did you set imageView.clipsToBounds = true :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: