我有一个带UIImageView的静态单元格。我希望将图像放在一个圆圈中。我尝试了很多代码......
实际上,我有:
cell.imageView.layer.cornerRadius = cell.imageView.frame.size.height /2;
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.borderWidth = 3;
cell.imageView.image = [UIImage imageNamed:@"defaultProfilePic.png"];
但它不起作用......只有borderWidth工作
我该怎么办?
(我有Quartz框架)
答案 0 :(得分:0)
cell.imageView.layer.cornerRadius = cell.imageView.frame.size.width / 2;
cell.imageView.clipsToBounds = YES;