如何快速將圖片切成圓角或圓形
我們直接利用 view的clipstobounds屬性以及其Layer的cornerRadius屬性就可以輕松做到,代碼如下:
imageView.clipstobounds = YES;
imageview.layer.cornerRadius = 5;
cornerRadius 的大小可以設(shè)置圓角的大小谊娇,如果需要圓形肺孤,直接設(shè)置成圖片高度的一半即可
我們直接利用 view的clipstobounds屬性以及其Layer的cornerRadius屬性就可以輕松做到,代碼如下:
imageView.clipstobounds = YES;
imageview.layer.cornerRadius = 5;
cornerRadius 的大小可以設(shè)置圓角的大小谊娇,如果需要圓形肺孤,直接設(shè)置成圖片高度的一半即可