how to set image in top avoiding space in UIimageView

前端 未结 3 1915
孤城傲影
孤城傲影 2021-01-13 21:00

I\'ve an UIImageView with content mode Aspect Fit of size 220x155. I\'m dynamically inserting different images in different resolutions, but all larger than the size of the

3条回答
  •  粉色の甜心
    2021-01-13 21:39

    Once the imageview's image is set to the new image (and thus scaled) you can get the height of the image inside the imageview (imageview.image.size.height) and set the imageview's height (frame) accordingly.

提交回复
热议问题