图像圆角化

6
有没有一种方法可以将我放置在ImageView中的图像的边角变圆?
1个回答

18
theImageView.layer.cornerRadius = 12;

可能还需要

theImageView.layer.masksToBounds = YES;

这对我很有效。你能否添加一些关于你如何使用它的详细信息或代码片段?这个图像视图是否大于图像? - drawnonward
2
当我使用 #import <QuartzCore/CALayer.h> 时,它对我非常有效。 - Josh Brown

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接