I have an app with images displayed in it. I have various images at different sizes displayed in my UIImageView
.
What I want to do is set a size for the image view - call it 100x100.
- If an image with a size overall less than 100x100 is put in the image view, I want the image view to center the image.
- If an image that is overall bigger than the view, e.g. 200x300, then I want the image view to center the image and scale it down until it just fits within the bounds of the image view.
Is there a way to do this in a normal UIImageView? Do I need to do some magic somewhere?