Hi
If I have an image larger than the image view size, haw to instruct the image view to deal with it in different ways, such is to show part of it, or resize it and stretch it, or resize and keeong the aspect ratio ?
--
Kindest Regards
Set the imageView.contentMode to what you need.
There are a lot of options to select:
case scaleToFillThe option to scale the content to fit the size of itself by changing the aspect ratio of the content if necessary.
case scaleAspectFitThe option to scale the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.
case scaleAspectFillThe option to scale the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.
case redrawThe option to redisplay the view when the bounds change by invoking the
setNeedsDisplay() method.case centerThe option to center the content in the view’s bounds, keeping the proportions the same.
case topThe option to center the content aligned at the top in the view’s bounds.
case bottomThe option to center the content aligned at the bottom in the view’s bounds.
case leftThe option to align the content on the left of the view.
case rightThe option to align the content on the right of the view.
case topLeftThe option to align the content in the top-left corner of the view.
case topRightThe option to align the content in the top-right corner of the view.
case bottomLeftThe option to align the content in the bottom-left corner of the view.
case bottomRightThe option to align the content in the bottom-right corner of the view.