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,

  • 相关阅读:
    leetcode Remove Linked List Elements
    leetcode Word Pattern
    leetcode Isomorphic Strings
    leetcode Valid Parentheses
    leetcode Remove Nth Node From End of List
    leetcode Contains Duplicate II
    leetcode Rectangle Area
    leetcode Length of Last Word
    leetcode Valid Sudoku
    leetcode Reverse Bits
  • 原文地址:https://www.cnblogs.com/fs-ios/p/4982826.html
Copyright © 2011-2022 走看看