您的位置:首页 > 移动开发 > IOS开发

iOS 如何让view指定圆角

2017-09-08 11:30 495 查看
    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 UIView边框 圆角