Given that I have a UIImage
that has some large frame.
I put this UIImage
into a UIImageView *myImageView;
I set the content mode of myImageView to UIViewContentModeScaleAspectFill
.
I also set the frame of myImageView to (50,50).
However, my UIImage
is significantly bigger than this smaller frame, and for some reason, the image always expands myImageView's frame size.
How do I ensure that myImageView's frame stays constant and doesn't change from image to image?
Thank you!
Is one side of the image matching the desired dimension (50)? If it is, I suspect that your view is still the intended size, but it is not being clipped. Try setting clipsToBounds
on your UIImageView to YES
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With