UIBezierPath*path=[UIBezierPath bezierPathWithRoundedRect:CGRectMake(0,0,50,50) byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(25, 25)];
//CGRectMake(0, 0, 50, 50)代表视图截取大小 cornerRadii:CGSizeMake(25, 25) 代表视图截取的圆角
CAShapeLayer *shapLayer = [CAShapeLayer layer];
shapLayer.path = path.CGPath;
headerImageView.layer.mask = shapLayer;