Hi, so I have a UIImageView in a UIView but when I run it in the iPhone Simulator, the image goes beyond the boundaries of the UIView. What's wrong...?
+3
A:
Have a look at the clipsToBounds
property of UIView
. If you set this to YES on your view the UIImageView shouldn't extend outside of that view any more.
Thomas Müller
2009-12-23 00:32:03
Under "Image View Attributes" (apple-1), click "Clip Subviews". This did it for me. The reason for going over the boundaries was because the original image was larger than the UIView.
Devoted
2009-12-23 00:42:28
A:
You may also benefit from using the Content Mode property in which you can specify how the content is drawn to fit the view. You can set it to fill, fit-to-scale, etc.
Jasarien
2009-12-23 03:13:33