设置两个圆角

来源:互联网 发布:如何理解矩阵的qr分解 编辑:程序博客网 时间:2024/06/07 06:28

UIImageView *myView = [[UIImageViewalloc] initWithFrame:CGRectMake(100,100, 100, 100)];

    myView.backgroundColor = [UIColorgreenColor];

    [selfaddSubview:myView];

    

    UIBezierPath *maskPath = [UIBezierPathbezierPathWithRoundedRect:myView.boundsbyRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRightcornerRadii:CGSizeMake([ScalemyWidth:3.f], [ScalemyWidth:3.f])];// UIRectCornerBottomRight通过这个设置

    CAShapeLayer *maskLayer = [CAShapeLayerlayer];

    maskLayer.frame = myView.bounds;

    maskLayer.path = maskPath.CGPath;

    myView.layer.mask = maskLayer;

0 0
原创粉丝点击