圆形图片

- (UIImageView *)cicleImageView:(UIImage *)image frame:(CGRect)frame radius:(CGFloat)radius{

UIImageView *iv = [[UIImageView alloc]initWithFrame:frame];

iv.image = image;

iv.layer.cornerRadius = radius; // 设置半径

iv.layer.masksToBounds = YES; //边界是否允许截取

return iv;

}

你可能感兴趣的:(圆形图片)