清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
scale的意思是:缩放,在contentMode中出现的话,就是要改变图形的大小了。
aspect的意思是纵横的比例,在contentMode中的意思是保持图形的纵横比,保持图片不变形。
scale aspect fill:在保持纵横比(aspect)的前提下,缩放图片(scale),使图片充满容器(fill)。
scale aspect fit: 在保持纵横比(aspect)的前提下,缩放图片(scale),使图片在容器内都显示出来(fit)。
scale to fill:缩放图片,使图片充满容器。因为没有aspect,所以是不保持纵横比的。
//摘自http://blog.csdn.net/iunion/article/details/7494511
UIViewContentMode
typedef enum {
UIViewContentModeScaleToFill,
UIViewContentModeScaleAspectFit, // contents scaled to fit with fixed aspect. remainder is transparent
UIViewContentModeScaleAspectFill, // contents scaled to fill with fixed aspect. some portion of content may be clipped.
UIViewContentModeRedraw, // redraw on bounds change (calls -setNeedsDisplay)
UIViewContentModeCenter, // contents remain same size. positioned adjusted.
UIViewContentModeTop,
UIViewContentModeBottom,
UIViewContentModeLeft,
UIViewContentModeRight,
UIViewContentModeTopLeft,
UIViewContentModeTopRight,
UIViewContentModeBottomLeft,
UIViewContentModeBottomRight,
} UIViewContentMode;