IOS 切任意角度

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:btn.bounds byRoundingCorners:UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];

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

            maskLayer.frame = btn.bounds;

            maskLayer.path = maskPath.CGPath;

      btn.layer.mask  = maskLayer;

图片发自App

你可能感兴趣的:(IOS 切任意角度)