问题 I have an image in the UIScrollView and I'm trying to make it aspect fill by default, the code below scale it as listed on the first attached image. But it's not what I expect, how to scale it properly? func aspectFill() { let imageSize = imageZoomView.bounds.size let xScale = bounds.width / imageSize.width let yScale = bounds.height / imageSize.height zoomScale = max(xScale, yScale) } But the expected result is 回答1: Make sure your image view is set to .scaleToFill . When you load your image,