【问题标题】:Dynamically set ImageView height for Image to fill ImageView width in Aspect fit mode在 Aspect fit 模式下动态设置 Image 的 ImageView 高度以填充 ImageView 宽度
【发布时间】:2019-03-09 00:46:06
【问题描述】:

是否可以在 Aspect Fit contentMode 中获取 ImageView 的高度值,该值将填充 ImageView 的宽度?

【问题讨论】:

标签: ios swift image imageview height


【解决方案1】:

高度 = image.height * imageView.width/image.width

【讨论】:

  • 你能再解释一下吗?
  • 你可以用这个公式获取 ImageView 的高度,该图像将填满 imageView 的宽度
猜你喜欢
  • 1970-01-01
  • 2011-03-09
  • 2022-11-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-22
  • 2011-04-01
  • 2013-02-06
相关资源
最近更新 更多