UIImageView的三种方式

字数 17阅读 43
UIImageView *imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"图片"]];
    /*
     UIViewContentModeScaleToFill,
     UIViewContentModeScaleAspectFit,      // contents scaled to fit with fixed aspect. remainder is transparent
     UIViewContentModeScaleAspectFill,
     */
    imgView.contentMode = UIViewContentModeScaleAspectFit;

fill是填充
fit是适应
aspect方面、形式
scale比例

推荐阅读更多精彩内容