iOS在处理图片的时候,会出现拉伸变形的情况,可以根据UIViewContentMode的属性,来控制图片

UIViewContentMode包含以下枚举值

   UIViewContentModeScaleToFill          :拉伸自适应填满整个视图

   UIViewContentModeScaleAspectFit    :自适应打下比例显示

   UIViewContentModeScaleAspectFill   :原始大小显示

   UIViewContentModeRedraw              :尺寸改变时重绘

   UIViewContentModeCenter               :中间

   UIViewContentModeTop                    :顶部

   UIViewContentModeBottom              :底部

   UIViewContentModeLeft                   :中间贴左

   UIViewContentModeRight                 :中间贴右

   UIViewContentModeTopLeft              :贴左上

   UIViewContentModeTopRight            :贴右上

     UIViewContentModeBottomLeft      :贴左下

     UIViewContentModeBottomRight    :贴右下

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2021-11-05
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2021-08-14
  • 2021-08-22
  • 2021-04-10
  • 2021-07-27
  • 2022-02-23
相关资源
相似解决方案