改变某一个视图的圆角

来源:互联网 发布:adaboost算法 编辑:程序博客网 时间:2024/05/16 19:00
 UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bgView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopLeft|UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:CGSizeMake(64, 64)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.bgView.bounds;
    maskLayer.path = maskPath.CGPath;
    
//    self.bgView.layer.cornerRadius = 20;
    
    self.bgView.layer.mask = maskLayer;
原创粉丝点击