UIViewContentModeScaleToFill 

UIViewContentModeScaleAspectFit 

UIViewContentModeScaleAspectFill 

UIViewContentModeRedraw 

UIViewContentModeCenter 

UIViewContentModeTop 

UIViewContentModeBottom 

UIViewContentModeLeft 

UIViewContentModeRight 

UIViewContentModeTopLeft 

UIViewContentModeTopRight 

UIViewContentModeBottomLeft 

UIViewContentModeBottomRight 

注意以上几个常量。凡是没有带Scale的。当图片尺寸超过 ImageView尺寸时,仅仅有部分显示在ImageView中。UIViewContentModeScaleToFill属性会导致图片变形。UIViewContentModeScaleAspectFit会保证图片比例不变,并且所有显示在ImageView中。这意味着ImageView会有部分空白。UIViewContentModeScaleAspectFill也会证图片比例不变,可是是填充整个ImageView的。可能仅仅有部分图片显示出来。

相关文章:

  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-13
  • 2022-02-07
  • 2022-12-23
  • 2021-11-08
  • 2021-12-13
  • 2021-12-12
相关资源
相似解决方案