2022-02-11 iOS 切任意圆角

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.hotBg.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(6, 6)];

    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

    maskLayer.frame=self.hotBg.bounds;

    maskLayer.path= maskPath.CGPath;

    self.hotBg.layer.mask= maskLayer;

你可能感兴趣的:(2022-02-11 iOS 切任意圆角)