UIView的contentMode属性

来源:互联网 发布:ubuntu 17.10 下载 编辑:程序博客网 时间:2024/05/22 17:07

今天看到一个设置的self.contentMode不知道干啥的

self.contentMode =UIViewContentModeRedraw;

看一下api:

typedef NS_ENUM(NSInteger, UIViewContentMode) {    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,};


看了一下别的blog,感觉这张图介绍这个属性很好,下面复制过来分享一下。


0 1