My code used to work before switching to SDWebImage. But now it is not working. I mean, the image is presented as a square as opposed to a circle. Here is my code
- (void)makeImageViewRound:(UIButton *)imageButton
{
imageButton.imageView.layer.cornerRadius = imageButton.imageView.bounds.size.width/2;
imageButton.imageView.clipsToBounds = YES;
imageButton.imageView.layer.borderWidth=0.5;
imageButton.imageView.layer.masksToBounds = YES;
imageButton.imageView.layer.borderColor=[[UIColor blackColor] CGColor];
}
…
self makeImageViewRound: self.catImageButton];
…
[self.catImageButton sd_setImageWithURL:catUrl forState:UIControlStateNormal];
I would rather not have to go in and change SDWebImage itself to solve this.