Reputation: 1991
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
Reputation: 318
It will work
imageView.contentMode = UIViewContentModeScaleToFill;
Upvotes: 0
Reputation: 254
UIImageView
view has a property imageView.contentMode
, which you can use to configure image displaying mode.
Upvotes: 0
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