設置某個視圖其中一個角爲圓角

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(120, 10, 80, 80)];spa

view.backgroundColor =[UIColor redColor];ci

[self.view addSubview:view];it

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

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

maskLayer.frame = view.bounds;di

maskLayer.path = maskPath.CGPath;view

view.layer.mask = maskLayer;vi

相關文章
相關標籤/搜索