美文网首页
ios中给UIview切两个或多个圆角

ios中给UIview切两个或多个圆角

作者: Torin76 | 来源:发表于2017-10-23 15:24 被阅读31次
        CGFloat ymax = CGRectGetMaxY(curentCarLabel.frame) +21;
        CGRect bounds = CGRectMake(0, 0, KScreenW, headView.frame.size.height - 10 - ymax);
        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(15, 15)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = bounds;
        maskLayer.path = maskPath.CGPath;
        [conerOfTwoView.layer addSublayer:maskLayer];
        conerOfTwoView.layer.mask = maskLayer;
        conerOfTwoView.layer.masksToBounds = YES;
        
    

    相关文章

      网友评论

          本文标题:ios中给UIview切两个或多个圆角

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