美文网首页
iOS如何将UIView单独切角

iOS如何将UIView单独切角

作者: 小木惊风 | 来源:发表于2018-01-10 14:43 被阅读10次

      UIRectCornerTopLeft = 1 << 0,  (左上)

        UIRectCornerTopRight    = 1 << 1,  (右上)

        UIRectCornerBottomLeft  = 1 << 2,  (左下)

        UIRectCornerBottomRight = 1 << 3,  (右下)

        UIRectCornerAllCorners  = ~0UL

    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.BID.bounds byRoundingCorners:UIRectCornerBottomRight cornerRadii:CGSizeMake(10*YZAdapter, 0)];

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

            maskLayer.frame = self.BID.bounds;

            maskLayer.path = maskPath.CGPath;

            self.BID.layer.mask = maskLayer;

    相关文章

      网友评论

          本文标题:iOS如何将UIView单独切角

          本文链接:https://www.haomeiwen.com/subject/issonxtx.html