添加固定位置圆角

来源:互联网 发布:iphone6s怎样设置网络 编辑:程序博客网 时间:2024/05/21 21:43
UIView *view = [[UIView alloc] init];
        view.backgroundColor = RGB(0xFF72809A);


        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(4, 4)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = view.bounds;
        maskLayer.path = maskPath.CGPath;
        view.layer.mask = maskLayer;
0 0