zoukankan      html  css  js  c++  java
  • UIImageView 的 contentMode

     1      UIViewContentModeScaleToFill,         // 按设置尺寸 - 填充
     2          UIViewContentModeScaleAspectFit,      // 按设置尺寸 - 等比例填充, 有边界
     3          UIViewContentModeScaleAspectFill,     // 按原来尺寸 - 填充, clipsToBounds切除边界
     4          UIViewContentModeRedraw,              // redraw on bounds change (calls -setNeedsDisplay)
     5          UIViewContentModeCenter,              // contents remain same size. positioned adjusted.
     6          UIViewContentModeTop,
     7          UIViewContentModeBottom,
     8          UIViewContentModeLeft,
     9          UIViewContentModeRight,
    10          UIViewContentModeTopLeft,
    11          UIViewContentModeTopRight,
    12          UIViewContentModeBottomLeft,
    13          UIViewContentModeBottomRight,
    14          
    15          1. 凡是带有scale单词的, 图片会被拉伸
    16          2. 凡是带有Aspect单词的, 图片会保持原来宽高比

    1. UIViewContentModeScaleToFill,         // 按设置尺寸 - 填充 -- 比例失调(填充整个imageView) 

     

     

    2. UIViewContentModeScaleAspectFill,     // 按图片宽高比 - 填充整个imageView,  clipsToBounds切除边界

      

    3. UIViewContentModeScaleAspectFit    // 按图片尺寸  -- 适配imageView, 会有边界(会显露背景)

    4. UIViewContentModeRedraw,              // 调用了setNeedDisplay方法时, 将会对图片重新渲染

    5. UIViewContentModeCenter,              // 以下不带scale的, 会将图片 直接按照设置放置.

             UIViewContentModeTop,

             UIViewContentModeBottom,

             UIViewContentModeLeft,

             UIViewContentModeRight,

             UIViewContentModeTopLeft,

             UIViewContentModeTopRight,

             UIViewContentModeBottomLeft,

             UIViewContentModeBottomRight,

     

  • 相关阅读:
    uvm_pkg——老板,打包带走
    uvm.sv——UVM之道
    uvm_comps.svh
    uvm_subscriber——告诉她我们来过
    uvm_monitor——借我一双慧眼
    编程面试过程中常见的10大算法(转)
    MySQL 分区表
    Nginx + Tomcat 动静分离实现负载均衡(转)
    浅析JVM内存结构和6大区域(转)
    Linux Shell编程变量赋值和引用
  • 原文地址:https://www.cnblogs.com/guangleijia/p/5110951.html
Copyright © 2011-2022 走看看