- (void)setCornerRadiusWithTopLeft:(CGFloat)topLefttopRight:(CGFloat)topRightbottomLeft:(CGFloat)bottomLeftbottomRight:(CGFloat)bottomRightimageView:(UIImageView*)imageView{
? ? CGFloatminX =CGRectGetMinX(imageView.bounds);
? ? CGFloatminY =CGRectGetMinY(imageView.bounds);
? ? CGFloatmaxX =CGRectGetMaxX(imageView.bounds);
? ? CGFloatmaxY =CGRectGetMaxY(imageView.bounds);
? ? CGFloattopLeftCenterX = minX + topLeft;
? ? CGFloattopLeftCenterY = minY + topLeft;
? ? CGFloattopRightCenterX = maxX - topRight;
? ? CGFloattopRightCenterY = minY + topRight;
? ? CGFloatbottomLeftCenterX = minX + bottomLeft;
? ? CGFloatbottomLeftCenterY = maxY - bottomLeft;
? ? CGFloatbottomRightCenterX = maxX - bottomRight;
? ? CGFloatbottomRightCenterY = maxY - bottomRight;
? ? UIBezierPath *path = [UIBezierPath bezierPath];
? ? [pathaddArcWithCenter:CGPointMake(topLeftCenterX, topLeftCenterY)radius:topLeftstartAngle:M_PIendAngle:3*M_PI/2.0clockwise:YES];
? ? [pathaddArcWithCenter:CGPointMake(topRightCenterX, topRightCenterY)radius:topRightstartAngle:3*M_PI/2.0endAngle:0clockwise:YES];
? ? [pathaddArcWithCenter:CGPointMake(bottomRightCenterX, bottomRightCenterY)radius:bottomRightstartAngle:0endAngle:M_PI_2clockwise:YES];
? ? [pathaddArcWithCenter:CGPointMake(bottomLeftCenterX, bottomLeftCenterY)radius:bottomLeftstartAngle:M_PI_2endAngle:M_PIclockwise:YES];
? ? CAShapeLayer*masklayer = [[CAShapeLayeralloc]init];
? ? masklayer.frame= imageView.bounds;
? ? masklayer.path= path.CGPath;
? ? imageView.layer.mask= masklayer;
}