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,

  • 相关阅读:
    jenkins持续集成
    对pm2对研究
    模板⽅法模式
    python configparser模块
    Python正则表达式
    Python读写文件之换行符
    Python字符串
    Python字典
    Python列表
    爬虫 urllib,requests,lxml,bs4 小结
  • 原文地址:https://www.cnblogs.com/fs-ios/p/4982826.html
Copyright © 2011-2022 走看看