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

    ContentMode中需要注意: 

     1.但凡取值中包含Scale单词的值都会拉伸图片.

     2.但是取值中包含Aspect单词的值都会按照图片的宽高比拉伸(不会变形)

     UIViewContentModeScaleToFill, // 默认  (会变形)

     ScaleToFill: 会按照ImageView的宽高比拉伸图片, 直到图片填充整个ImageView为止, 并且要求图片的上下左右都必须和ImageView对齐

     UIViewContentModeScaleAspectFit, (不会变形)

     AspectFit:会按照图片的宽高比拉伸, 直到图片的上下"或"者左右和ImageView对齐为止, 并且要求整张图片都在ImageView中, 然后居中显示

     UIViewContentModeScaleAspectFill, (不会变形)

    AspectFill: 会按照图片的宽高比拉伸, 直到图片的上下"或"者左右和ImageView对齐并且图片的填充整个ImageView为止, 然后居中显示

     UIViewContentModeRedraw,            

     UIViewContentModeCenter,

     UIViewContentModeTop,

     UIViewContentModeBottom,

     UIViewContentModeLeft,

     UIViewContentModeRight,

     UIViewContentModeTopLeft,

     UIViewContentModeTopRight,

     UIViewContentModeBottomLeft,

     UIViewContentModeBottomRight,

  • 相关阅读:
    关于《iBoard 电子学堂》的学习及进阶方式(精 转)
    OV7670 RAW输出 bayer 解码
    yuv和yCbCr的差异
    LeetCode--Anagrams
    LeetCode--N-Queens
    LeetCode--Gas Station
    GDB调试(转)
    LeetCode--Word Search
    Ptrace_scope的作用及设置
    LeetCode--Gray Code
  • 原文地址:https://www.cnblogs.com/fs-ios/p/4982826.html
Copyright © 2011-2022 走看看