zoukankan      html  css  js  c++  java
  • iOS开发系列-UIImageView的contentMode

    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,
    };
    

    UIViewContentModeScaleAspectFit:会保证图片比例不变,等比缩放,使得图片能够完全显示在UIImageView,会导致UIImageView有空白
    UIViewContentModeScaleAspectFill:会保证图片比例不变,等比缩放,使得UIImageView被图片填充,会导致图片显示不完全。

    官方给了一组图片如下:

  • 相关阅读:
    Sass
    Less文件的建立
    面试问题整理
    高光谱图像分类部分名词解析
    监督学习,无监督学习和半监督学习
    git
    node.js安装及其环境配置
    浏览器从输入网址到渲染出页面的过程
    node的api
    模块与包管理工具
  • 原文地址:https://www.cnblogs.com/CoderHong/p/9254523.html
Copyright © 2011-2022 走看看