将view指定的角设置为圆角
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)]; view.backgroundColor = [UIColor redColor]; [self.view addSubview:view]; UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)]; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = view.bounds; maskLayer.path = maskPath.CGPath; view.layer.mask = maskLayer;