iOS 如何让view指定圆角

    UIView *contentView = [[UIView alloc]initWithFrame:CGRectMake((KScreenW-view_W(300))/2, 260/AutoWidth, view_W(300), view_H(250))];

    [contentView setBackgroundColor:[UIColor whiteColor]];

    [bgView addSubview:contentView];

    

    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:contentView.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii:CGSizeMake(10, 10)];

    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

    maskLayer.frame = contentView.bounds;

    maskLayer.path = maskPath.CGPath;

    contentView.layer.mask = maskLayer;


你可能感兴趣的:(iOS 如何让view指定圆角)