Circular UIImageView in UITableView without performance hit?

前端 未结 14 2620
失恋的感觉
失恋的感觉 2020-12-12 09:50

I have a UIImageView on each of my UITableView cells, that display a remote image (using SDWebImage). I\'ve done some QuartzCore

14条回答
  •  时光说笑
    2020-12-12 10:08

    Set the height & width of the of the UIImageView to be the same e.g.:Height=60 & Width = 60, then the cornerRadius should be exactly the half.I have kept it 30 in my case.It worked for me.

     self.imageView.layer.cornerRadius = 30;
     self.imageView.layer.borderWidth = 3;
     self.imageView.layer.borderColor = [UIColor whiteColor].CGColor;
     self.imageView.layer.masksToBounds = YES;
    

提交回复
热议问题