ios view部分圆角

    UIRectCorner corner = UIRectCornerTopRight | UIRectCornerTopLeft; // 圆角位置,全部位置
    UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:self.btnImg.bounds byRoundingCorners:corner cornerRadii:CGSizeMake(5, 5)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.btnImg.bounds;
    maskLayer.path = path.CGPath;
    view.layer.mask = maskLayer;

你可能感兴趣的:(oc---细节)