开发者

Using UIViewContentModeScaleAspectFit to fill view?

开发者 https://www.devze.com 2023-03-19 11:50 出处:网络
Wh开发者_JAVA技巧at 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???As for as I know, you\'ve

Wh开发者_JAVA技巧at 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???


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消