iOS 只有一边切圆角

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:monthLabel.bounds byRoundingCorners:UIRectCornerBottomRight|UIRectCornerTopRight cornerRadii:CGSizeMake(6, 6)];
    
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    
    maskLayer.frame = monthLabel.bounds;
    
    maskLayer.path = maskPath.CGPath;
    monthLabel.layer.mask = maskLayer;

你可能感兴趣的:(iOS 只有一边切圆角)