0000 0000 0000 0010
写于2015.04.03 14:36
ScaleToFill、ScaleAspectFit、ScaleAspectFill
今天码代码又碰到这个,不理解透彻是真不行了,有点伤脑筋啊~
首先,百度谷歌了下,没啥好文章。草草看了几篇,基本都是差不多的内容。
然后,上stackoverflow,有人问过这三者之间有啥不同。第一个回答纯文字,如下:
UIViewContentModeScaleToFill
Scales the content to fit the size of itself by changing the aspect ratio of the content if necessary.
UIViewContentModeScaleAspectFit
Scales the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.
UIViewContentModeScaleAspectFill
Scales the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.