As shown in the picture: This is a screenshot of a 6s mobile phone. I put him in a UIImageView with a width = mobile phone screen width and a height of 210. This picture is obtained through network loading. Here I use SDWebImage. Now I want the image to look better, my idea is to crop this image. The problem is that the network request here is asynchronous. I don't know where to handle it.
My core problem is that I don’t know where to crop the web image loaded based on SDWebImage after it is loaded.
I want the online pictures to be displayed as follows: I already have the code for the cropping part. I just don't know where to modify it.
Use the download option
SDWebImageAvoidAutoSetImage
, 下载完成后在后台剪裁,然后在主线程设置image并调用刷新。可以给
UIImageView
Write a category for easy calling.