0

My app allows a user to select any photo they'd like from their photo library. If the image is bigger than the dimensions of UIImage , the photo will cover the screen (uiimage space is only half the screen). How do I resize the image to take the whole space of the uiImage view that I gave it depending on the size of the devices screen?

Sorry if it's too simple of a question to be asked, but I am new to stack overflow and iOS programming.

Mazen
  • 45
  • 9
  • Have a look at the `contentMode` property on your `UIImageView` – Paulw11 Jan 18 '15 at 23:26
  • possible duplicate of [How to manage UIImageView content mode?](http://stackoverflow.com/questions/14134035/how-to-manage-uiimageview-content-mode) – Paulw11 Jan 18 '15 at 23:27

1 Answers1

0

Try setting the content mode:

imageView.contentMode = UIViewContentModeScaleAspectFit;

This will display the image within the UIImageViews's dimension.

Rashad
  • 11,057
  • 4
  • 45
  • 73