Aleem
Aleem

Reputation: 3291

Using UIViewContentModeScaleAspectFit to fill view?

What will be best or standard aspect ratio of image to fill view using UIViewContentModeScaleAspectFit, or what'll be best resolution of image to fill view???

Upvotes: 0

Views: 399

Answers (1)

EmptyStack
EmptyStack

Reputation: 51374

As for as I know, you've no need to worry about the aspect ratio of image. If you set the content mode of the view to UIViewContentModeScaleAspectFit, then it

Scales the content to fit the size of the view. This option maintains the aspect ratio of the content. Any remaining area of the view’s bounds is transparent.

If the image size is 60x40, and your views size is 200x200, the image will be displayed in the size 180x120, centered on its superview. And your image may loose some details if its superview is too large to fit.

Upvotes: 1

Related Questions