UIView 的部分圓角的設定

weixin_33806914發表於2019-02-26
// UIView 的部分圓角的設定
UIBezierPath*maskPath = [UIBezierPath bezierPathWithRoundedRect:self.tipInfoSubView.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerTopLeft) cornerRadii:CGSizeMake(4,4)];//圓角大小
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = self.tipInfoSubView.bounds;
        maskLayer.path = maskPath.CGPath;
        self.tipInfoSubView.layer.mask = maskLayer;

相關文章