Abuzar Amin
Abuzar Amin

Reputation: 1991

Showing Full Image in UIImageView

I am using UIImageView to show an Image. But when image populates in ImageView it shows a part of Image (upper part ) not the full image, as image is large.
I was wondering if there is any way to show full Image in ImageView without using scroll view so that user can have a view of full image at once without scrolling.

Upvotes: 1

Views: 1343

Answers (3)

Ravikanth
Ravikanth

Reputation: 318

It will work

imageView.contentMode = UIViewContentModeScaleToFill;

Upvotes: 0

mike-dutka
mike-dutka

Reputation: 254

UIImageView view has a property imageView.contentMode, which you can use to configure image displaying mode.

Upvotes: 0

Dario
Dario

Reputation: 3135

You can change the content mode of the UIImageView. In the Attributes inspector you can change it, for example to "Scale to Fill".

You can do this by code too, for example, in Objective-C:

imageView.contentMode = UIViewContentModeScaleToFill;

If you want to keep the aspect you could set it to UIViewContentModeScaleAspectFit.

Upvotes: 1

Related Questions